; LLVM IR from VastoLorde95/Competitive-Programming :: CodeChef/WF/Easy Medium/ANKGAME/A.ll (Z5solvev)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_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::_Rb_tree_iterator" = type { ptr }
%"struct.std::pair" = type <{ i64, i32, [4 x i8] }>

@f = external dso_local global [100100 x i64], align 16
@invf = external dso_local global [100100 x i64], align 16
@a = external dso_local global [100100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [107 x i8], align 1
@__PRETTY_FUNCTION__._Z5solvev = external hidden unnamed_addr constant [13 x i8], align 1
@_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: 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 noundef i64 @_Z1Cii(i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::map", align 8
  %3 = alloca i32, align 4
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca ptr, align 8
  %9 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %10 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i64, align 8
  %15 = alloca i64, align 8
  %16 = alloca ptr, align 8
  %17 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %18 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %19 = alloca %"struct.std::pair", align 8
  %20 = alloca i64, align 8
  %21 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #7
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 48, ptr %2) #7
  call void @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %23

23:                                               ; preds = %41, %0
  %24 = load i32, ptr %3, align 4, !tbaa !5
  %25 = load i32, ptr %1, align 4, !tbaa !5
  %26 = icmp slt i32 %24, %25
  br i1 %26, label %28, label %27

27:                                               ; preds = %23
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %48

28:                                               ; preds = %23
  %29 = load i32, ptr %3, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %30
  %32 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %31)
          to label %33 unwind label %44

33:                                               ; preds = %28
  %34 = load i32, ptr %3, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %35
  %37 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %36)
          to label %38 unwind label %44

38:                                               ; preds = %33
  %39 = load i32, ptr %37, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %37, align 4, !tbaa !5
  br label %41

41:                                               ; preds = %38
  %42 = load i32, ptr %3, align 4, !tbaa !5
  %43 = add nsw i32 %42, 1
  store i32 %43, ptr %3, align 4, !tbaa !5
  br label %23, !llvm.loop !9

44:                                               ; preds = %33, %28
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %4, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  br label %219

48:                                               ; preds = %27
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  store i64 1, ptr %6, align 8, !tbaa !11
  %49 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %50 unwind label %67

50:                                               ; preds = %48
  %51 = load i32, ptr %49, align 4, !tbaa !5
  %52 = icmp eq i32 %51, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br i1 %52, label %53, label %104

53:                                               ; preds = %50
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %54 = load i32, ptr %1, align 4, !tbaa !5
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100100 x i64], ptr @f, i64 0, i64 %55
  %57 = load i64, ptr %56, align 8, !tbaa !11
  store i64 %57, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  store ptr %2, ptr %8, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %58 = load ptr, ptr %8, align 8, !tbaa !13
  %59 = call ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %58) #7
  %60 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %9, i32 0, i32 0
  store ptr %59, ptr %60, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %61 = load ptr, ptr %8, align 8, !tbaa !13
  %62 = call ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %61) #7
  %63 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %10, i32 0, i32 0
  store ptr %62, ptr %63, align 8
  br label %64

64:                                               ; preds = %81, %53
  %65 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKxiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %65, label %71, label %66

66:                                               ; preds = %64
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %83

67:                                               ; preds = %48
  %68 = landingpad { ptr, i32 }
          cleanup
  %69 = extractvalue { ptr, i32 } %68, 0
  store ptr %69, ptr %4, align 8
  %70 = extractvalue { ptr, i32 } %68, 1
  store i32 %70, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  br label %219

71:                                               ; preds = %64
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  %72 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %72, i64 16, i1 false)
  %73 = load i64, ptr %7, align 8, !tbaa !11
  %74 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 1
  %75 = load i32, ptr %74, align 8, !tbaa !15
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [100100 x i64], ptr @invf, i64 0, i64 %76
  %78 = load i64, ptr %77, align 8, !tbaa !11
  %79 = mul nsw i64 %73, %78
  %80 = srem i64 %79, 1000000007
  store i64 %80, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %81

81:                                               ; preds = %71
  %82 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKxiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  br label %64

83:                                               ; preds = %66
  %84 = load i64, ptr %7, align 8, !tbaa !11
  %85 = icmp sle i64 0, %84
  br i1 %85, label %86, label %89

86:                                               ; preds = %83
  %87 = load i64, ptr %7, align 8, !tbaa !11
  %88 = icmp slt i64 %87, 1000000007
  br label %89

89:                                               ; preds = %86, %83
  %90 = phi i1 [ false, %83 ], [ %88, %86 ]
  br i1 %90, label %91, label %92

91:                                               ; preds = %89
  br label %94

92:                                               ; preds = %89
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 91, ptr noundef @__PRETTY_FUNCTION__._Z5solvev) #8
  unreachable

93:                                               ; No predecessors!
  br label %94

94:                                               ; preds = %93, %91
  %95 = load i64, ptr %7, align 8, !tbaa !11
  %96 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %95)
          to label %97 unwind label %100

97:                                               ; preds = %94
  %98 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %96, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %99 unwind label %100

99:                                               ; preds = %97
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %218

100:                                              ; preds = %97, %94
  %101 = landingpad { ptr, i32 }
          cleanup
  %102 = extractvalue { ptr, i32 } %101, 0
  store ptr %102, ptr %4, align 8
  %103 = extractvalue { ptr, i32 } %101, 1
  store i32 %103, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  br label %219

104:                                              ; preds = %50
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  store i64 1, ptr %14, align 8, !tbaa !11
  %105 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %14)
          to label %106 unwind label %120

106:                                              ; preds = %104
  %107 = load i32, ptr %105, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  store i32 %107, ptr %13, align 4, !tbaa !5
  %108 = load i32, ptr %13, align 4, !tbaa !5
  %109 = load i32, ptr %1, align 4, !tbaa !5
  %110 = icmp eq i32 %108, %109
  br i1 %110, label %111, label %134

111:                                              ; preds = %106
  %112 = load i32, ptr %1, align 4, !tbaa !5
  %113 = srem i32 %112, 2
  %114 = icmp eq i32 %113, 1
  br i1 %114, label %115, label %128

115:                                              ; preds = %111
  %116 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 1)
          to label %117 unwind label %124

117:                                              ; preds = %115
  %118 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %116, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %119 unwind label %124

119:                                              ; preds = %117
  br label %133

120:                                              ; preds = %104
  %121 = landingpad { ptr, i32 }
          cleanup
  %122 = extractvalue { ptr, i32 } %121, 0
  store ptr %122, ptr %4, align 8
  %123 = extractvalue { ptr, i32 } %121, 1
  store i32 %123, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %217

124:                                              ; preds = %130, %128, %117, %115
  %125 = landingpad { ptr, i32 }
          cleanup
  %126 = extractvalue { ptr, i32 } %125, 0
  store ptr %126, ptr %4, align 8
  %127 = extractvalue { ptr, i32 } %125, 1
  store i32 %127, ptr %5, align 4
  br label %217

128:                                              ; preds = %111
  %129 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
          to label %130 unwind label %124

130:                                              ; preds = %128
  %131 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %129, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %132 unwind label %124

132:                                              ; preds = %130
  br label %133

133:                                              ; preds = %132, %119
  store i32 1, ptr %12, align 4
  br label %216

134:                                              ; preds = %106
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %135 = load i32, ptr %1, align 4, !tbaa !5
  %136 = load i32, ptr %13, align 4, !tbaa !5
  %137 = sub nsw i32 %135, %136
  %138 = sext i32 %137 to i64
  %139 = getelementptr inbounds [100100 x i64], ptr @f, i64 0, i64 %138
  %140 = load i64, ptr %139, align 8, !tbaa !11
  store i64 %140, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  store ptr %2, ptr %16, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %141 = load ptr, ptr %16, align 8, !tbaa !13
  %142 = call ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %141) #7
  %143 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %17, i32 0, i32 0
  store ptr %142, ptr %143, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %144 = load ptr, ptr %16, align 8, !tbaa !13
  %145 = call ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %144) #7
  %146 = getelementptr inbounds %"struct.std::_Rb_tree_iterator", ptr %18, i32 0, i32 0
  store ptr %145, ptr %146, align 8
  br label %147

147:                                              ; preds = %168, %134
  %148 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKxiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  br i1 %148, label %150, label %149

149:                                              ; preds = %147
  store i32 7, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  br label %170

150:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  %151 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %19, ptr align 8 %151, i64 16, i1 false)
  %152 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 0
  %153 = load i64, ptr %152, align 8, !tbaa !17
  %154 = icmp eq i64 %153, 1
  br i1 %154, label %155, label %156

155:                                              ; preds = %150
  store i32 8, ptr %12, align 4
  br label %165

156:                                              ; preds = %150
  %157 = load i64, ptr %15, align 8, !tbaa !11
  %158 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %159 = load i32, ptr %158, align 8, !tbaa !15
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [100100 x i64], ptr @invf, i64 0, i64 %160
  %162 = load i64, ptr %161, align 8, !tbaa !11
  %163 = mul nsw i64 %157, %162
  %164 = srem i64 %163, 1000000007
  store i64 %164, ptr %15, align 8, !tbaa !11
  store i32 0, ptr %12, align 4
  br label %165

165:                                              ; preds = %156, %155
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  %166 = load i32, ptr %12, align 4
  switch i32 %166, label %225 [
    i32 0, label %167
    i32 8, label %168
  ]

167:                                              ; preds = %165
  br label %168

168:                                              ; preds = %167, %165
  %169 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKxiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %17) #7
  br label %147

170:                                              ; preds = %149
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 0, ptr %20, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !5
  br label %171

171:                                              ; preds = %192, %170
  %172 = load i32, ptr %21, align 4, !tbaa !5
  %173 = load i32, ptr %13, align 4, !tbaa !5
  %174 = icmp sle i32 %172, %173
  br i1 %174, label %176, label %175

175:                                              ; preds = %171
  store i32 9, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %195

176:                                              ; preds = %171
  %177 = load i32, ptr %1, align 4, !tbaa !5
  %178 = load i32, ptr %21, align 4, !tbaa !5
  %179 = sub nsw i32 %177, %178
  %180 = sub nsw i32 %179, 1
  %181 = load i32, ptr %13, align 4, !tbaa !5
  %182 = load i32, ptr %21, align 4, !tbaa !5
  %183 = sub nsw i32 %181, %182
  %184 = call noundef i64 @_Z1Cii(i32 noundef %180, i32 noundef %183)
  %185 = load i64, ptr %15, align 8, !tbaa !11
  %186 = mul nsw i64 %184, %185
  %187 = srem i64 %186, 1000000007
  %188 = load i64, ptr %20, align 8, !tbaa !11
  %189 = add nsw i64 %188, %187
  store i64 %189, ptr %20, align 8, !tbaa !11
  %190 = load i64, ptr %20, align 8, !tbaa !11
  %191 = srem i64 %190, 1000000007
  store i64 %191, ptr %20, align 8, !tbaa !11
  br label %192

192:                                              ; preds = %176
  %193 = load i32, ptr %21, align 4, !tbaa !5
  %194 = add nsw i32 %193, 2
  store i32 %194, ptr %21, align 4, !tbaa !5
  br label %171, !llvm.loop !18

195:                                              ; preds = %175
  %196 = load i64, ptr %20, align 8, !tbaa !11
  %197 = icmp sle i64 0, %196
  br i1 %197, label %198, label %201

198:                                              ; preds = %195
  %199 = load i64, ptr %20, align 8, !tbaa !11
  %200 = icmp slt i64 %199, 1000000007
  br label %201

201:                                              ; preds = %198, %195
  %202 = phi i1 [ false, %195 ], [ %200, %198 ]
  br i1 %202, label %203, label %204

203:                                              ; preds = %201
  br label %206

204:                                              ; preds = %201
  call void @__assert_fail(ptr noundef @.str, ptr noundef @.str.1, i32 noundef 120, ptr noundef @__PRETTY_FUNCTION__._Z5solvev) #8
  unreachable

205:                                              ; No predecessors!
  br label %206

206:                                              ; preds = %205, %203
  %207 = load i64, ptr %20, align 8, !tbaa !11
  %208 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %207)
          to label %209 unwind label %212

209:                                              ; preds = %206
  %210 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %208, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %211 unwind label %212

211:                                              ; preds = %209
  store i32 1, ptr %12, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %216

212:                                              ; preds = %209, %206
  %213 = landingpad { ptr, i32 }
          cleanup
  %214 = extractvalue { ptr, i32 } %213, 0
  store ptr %214, ptr %4, align 8
  %215 = extractvalue { ptr, i32 } %213, 1
  store i32 %215, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  br label %217

216:                                              ; preds = %211, %133
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %218

217:                                              ; preds = %212, %124, %120
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  br label %219

218:                                              ; preds = %216, %99
  call void @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #7
  ret void

219:                                              ; preds = %217, %100, %67, %44
  call void @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #7
  br label %220

220:                                              ; preds = %219
  %221 = load ptr, ptr %4, align 8
  %222 = load i32, ptr %5, align 4
  %223 = insertvalue { ptr, i32 } poison, ptr %221, 0
  %224 = insertvalue { ptr, i32 } %223, i32 %222, 1
  resume { ptr, i32 } %224

225:                                              ; preds = %165
  unreachable
}

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

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

; 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 i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) #2 align 2

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

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #5

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) 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 = { "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 nounwind willreturn memory(argmem: readwrite) }
attributes #5 = { noreturn 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 #6 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { nounwind }
attributes #8 = { noreturn 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 = !{!14, !14, i64 0}
!14 = !{!"any pointer", !7, i64 0}
!15 = !{!16, !6, i64 8}
!16 = !{!"_ZTSSt4pairIKxiE", !12, i64 0, !6, i64 8}
!17 = !{!16, !12, i64 0}
!18 = distinct !{!18, !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_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::map" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<long long, std::pair<const long long, int>, std::_Select1st<std::pair<const long long, int>>, std::less<long long>>::_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::_Rb_tree_iterator" = type { ptr }

@f = external dso_local local_unnamed_addr global [100100 x i64], align 16
@invf = external dso_local local_unnamed_addr global [100100 x i64], align 16
@a = external dso_local global [100100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [23 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [107 x i8], align 1
@__PRETTY_FUNCTION__._Z5solvev = external hidden unnamed_addr constant [13 x i8], align 1
@_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 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 noundef i64 @_Z1Cii(i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::map", align 8
  %3 = alloca i64, align 8
  %4 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %5 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %6 = alloca i64, align 8
  %7 = alloca %"struct.std::_Rb_tree_iterator", align 8
  %8 = alloca %"struct.std::_Rb_tree_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %9 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %2) #6
  call void @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  %10 = load i32, ptr %1, align 4, !tbaa !5
  %11 = icmp sgt i32 %10, 0
  br i1 %11, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %17, %0
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #6
  store i64 1, ptr %3, align 8, !tbaa !9
  %12 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %3)
          to label %25 unwind label %37

.lr.ph:                                           ; preds = %0, %17
  %indvars.iv = phi i64 [ %indvars.iv.next, %17 ], [ 0, %0 ]
  %13 = getelementptr inbounds [100100 x i64], ptr @a, i64 0, i64 %indvars.iv
  %14 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %15 unwind label %23

15:                                               ; preds = %.lr.ph
  %16 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %17 unwind label %23

17:                                               ; preds = %15
  %18 = load i32, ptr %16, align 4, !tbaa !5
  %19 = add nsw i32 %18, 1
  store i32 %19, ptr %16, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr %1, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %22 = icmp slt i64 %indvars.iv.next, %21
  br i1 %22, label %.lr.ph, label %._crit_edge, !llvm.loop !11

23:                                               ; preds = %15, %.lr.ph
  %24 = landingpad { ptr, i32 }
          cleanup
  br label %106

25:                                               ; preds = %._crit_edge
  %26 = load i32, ptr %12, align 4, !tbaa !5
  %27 = icmp eq i32 %26, 0
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br i1 %27, label %28, label %54

28:                                               ; preds = %25
  %29 = load i32, ptr %1, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [100100 x i64], ptr @f, i64 0, i64 %30
  %32 = load i64, ptr %31, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  %33 = call ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  store ptr %33, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  %34 = call ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  store ptr %34, ptr %5, align 8
  %35 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKxiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br i1 %35, label %.lr.ph58, label %._crit_edge59

._crit_edge59:                                    ; preds = %.lr.ph58, %28
  %.035.lcssa = phi i64 [ %32, %28 ], [ %44, %.lr.ph58 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %36 = icmp ult i64 %.035.lcssa, 1000000007
  br i1 %36, label %48, label %47

37:                                               ; preds = %._crit_edge
  %38 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #6
  br label %106

.lr.ph58:                                         ; preds = %28, %.lr.ph58
  %.03556 = phi i64 [ %44, %.lr.ph58 ], [ %32, %28 ]
  %39 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %.sroa.3.0..sroa_idx = getelementptr inbounds i8, ptr %39, i64 8
  %.sroa.3.0.copyload = load i32, ptr %.sroa.3.0..sroa_idx, align 8
  %40 = sext i32 %.sroa.3.0.copyload to i64
  %41 = getelementptr inbounds [100100 x i64], ptr @invf, i64 0, i64 %40
  %42 = load i64, ptr %41, align 8, !tbaa !9
  %43 = mul nsw i64 %42, %.03556
  %44 = srem i64 %43, 1000000007
  %45 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKxiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #6
  %46 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKxiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #6
  br i1 %46, label %.lr.ph58, label %._crit_edge59

47:                                               ; preds = %._crit_edge59
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 91, ptr noundef nonnull @__PRETTY_FUNCTION__._Z5solvev) #7
  unreachable

48:                                               ; preds = %._crit_edge59
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.035.lcssa)
          to label %50 unwind label %52

50:                                               ; preds = %48
  %51 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %49, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %105 unwind label %52

52:                                               ; preds = %50, %48
  %53 = landingpad { ptr, i32 }
          cleanup
  br label %106

54:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  store i64 1, ptr %6, align 8, !tbaa !9
  %55 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48) %2, ptr noundef nonnull align 8 dereferenceable(8) %6)
          to label %56 unwind label %64

56:                                               ; preds = %54
  %57 = load i32, ptr %55, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  %58 = load i32, ptr %1, align 4, !tbaa !5
  %59 = icmp eq i32 %57, %58
  br i1 %59, label %.invoke66, label %69

.invoke66:                                        ; preds = %56
  %60 = and i32 %57, -2147483647
  %61 = icmp eq i32 %60, 1
  %62 = zext i1 %61 to i32
  %63 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %62)
          to label %.invoke unwind label %66

64:                                               ; preds = %54
  %65 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  br label %106

66:                                               ; preds = %.invoke66, %.invoke
  %67 = landingpad { ptr, i32 }
          cleanup
  br label %106

.invoke:                                          ; preds = %.invoke66
  %68 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %63, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %105 unwind label %66

69:                                               ; preds = %56
  %70 = sub nsw i32 %58, %57
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds [100100 x i64], ptr @f, i64 0, i64 %71
  %73 = load i64, ptr %72, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %74 = call ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  store ptr %74, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %75 = call ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEE3endEv(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  store ptr %75, ptr %8, align 8
  %76 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKxiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %76, label %.lr.ph47, label %._crit_edge48

._crit_edge48:                                    ; preds = %85, %69
  %.036.lcssa = phi i64 [ %73, %69 ], [ %.137, %85 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  %.not49 = icmp slt i32 %57, 0
  br i1 %.not49, label %._crit_edge54.thread, label %.lr.ph53

.lr.ph47:                                         ; preds = %69, %85
  %.03645 = phi i64 [ %.137, %85 ], [ %73, %69 ]
  %77 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNKSt17_Rb_tree_iteratorISt4pairIKxiEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %.sroa.0.0.copyload = load i64, ptr %77, align 8
  %78 = icmp eq i64 %.sroa.0.0.copyload, 1
  br i1 %78, label %85, label %79

79:                                               ; preds = %.lr.ph47
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %77, i64 8
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 8
  %80 = sext i32 %.sroa.4.0.copyload to i64
  %81 = getelementptr inbounds [100100 x i64], ptr @invf, i64 0, i64 %80
  %82 = load i64, ptr %81, align 8, !tbaa !9
  %83 = mul nsw i64 %82, %.03645
  %84 = srem i64 %83, 1000000007
  br label %85

85:                                               ; preds = %.lr.ph47, %79
  %.137 = phi i64 [ %84, %79 ], [ %.03645, %.lr.ph47 ]
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt17_Rb_tree_iteratorISt4pairIKxiEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #6
  %87 = call noundef zeroext i1 @_ZStneRKSt17_Rb_tree_iteratorISt4pairIKxiEES5_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #6
  br i1 %87, label %.lr.ph47, label %._crit_edge48

._crit_edge54:                                    ; preds = %.lr.ph53
  %88 = icmp sgt i64 %97, -1
  br i1 %88, label %._crit_edge54.thread, label %99

.lr.ph53:                                         ; preds = %._crit_edge48, %.lr.ph53
  %.051 = phi i32 [ %98, %.lr.ph53 ], [ 0, %._crit_edge48 ]
  %.03050 = phi i64 [ %97, %.lr.ph53 ], [ 0, %._crit_edge48 ]
  %89 = load i32, ptr %1, align 4, !tbaa !5
  %90 = xor i32 %.051, -1
  %91 = add i32 %89, %90
  %92 = sub nsw i32 %57, %.051
  %93 = call noundef i64 @_Z1Cii(i32 noundef %91, i32 noundef %92)
  %94 = mul nsw i64 %93, %.036.lcssa
  %95 = srem i64 %94, 1000000007
  %96 = add nsw i64 %95, %.03050
  %97 = srem i64 %96, 1000000007
  %98 = add nuw nsw i32 %.051, 2
  %.not = icmp sgt i32 %98, %57
  br i1 %.not, label %._crit_edge54, label %.lr.ph53, !llvm.loop !13

99:                                               ; preds = %._crit_edge54
  call void @__assert_fail(ptr noundef nonnull @.str, ptr noundef nonnull @.str.1, i32 noundef 120, ptr noundef nonnull @__PRETTY_FUNCTION__._Z5solvev) #7
  unreachable

._crit_edge54.thread:                             ; preds = %._crit_edge48, %._crit_edge54
  %.030.lcssa64 = phi i64 [ %97, %._crit_edge54 ], [ 0, %._crit_edge48 ]
  %100 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.030.lcssa64)
          to label %101 unwind label %103

101:                                              ; preds = %._crit_edge54.thread
  %102 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %100, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %105 unwind label %103

103:                                              ; preds = %101, %._crit_edge54.thread
  %104 = landingpad { ptr, i32 }
          cleanup
  br label %106

105:                                              ; preds = %.invoke, %101, %50
  call void @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret void

106:                                              ; preds = %64, %66, %103, %52, %37, %23
  %.pn42 = phi { ptr, i32 } [ %24, %23 ], [ %53, %52 ], [ %38, %37 ], [ %67, %66 ], [ %104, %103 ], [ %65, %64 ]
  call void @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %2) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn42
}

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

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

; 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 i32 @__gxx_personality_v0(...)

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixERS3_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #2 align 2

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #4

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt3mapIxiSt4lessIxESaISt4pairIKxiEEED2Ev(ptr noundef nonnull align 8 dereferenceable(48)) 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 = { "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 = { noreturn 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 #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 = { nounwind }
attributes #7 = { noreturn 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 = !{!10, !10, i64 0}
!10 = !{!"long long", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}


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