; LLVM IR from bqi343/cp-notebook :: Contests/USACO Solutions/2018-19/Jan 2019/Gold (poetry)

; 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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }
%"struct.std::pair.2" = type { i8, i32 }

@MOD = external dso_local global i64, align 8
@dp = external dso_local global [5005 x i64], align 16
@r = external dso_local global [5005 x i64], align 16
@umap = external dso_local global %"class.std::unordered_map", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3expii(i32 noundef, i32 noundef) #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::basic_ifstream", align 8
  %3 = alloca %"class.std::basic_ofstream", align 8
  %4 = alloca ptr, align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca ptr, align 8
  %10 = alloca i64, align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 4
  %15 = alloca i32, align 4
  %16 = alloca i8, align 1
  %17 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %18 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i64, align 8
  %23 = alloca ptr, align 8
  %24 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %25 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %26 = alloca %"struct.std::pair.2", align 4
  %27 = alloca i32, align 4
  %28 = alloca i64, align 8
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %30 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %31 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %32 = getelementptr i8, ptr %31, i64 -24
  %33 = load i64, ptr %32, align 8
  %34 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %33
  %35 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %34, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 520, ptr %2) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %2, ptr noundef @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr %3) #7
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %3, ptr noundef @.str.2, i32 noundef 16)
          to label %36 unwind label %61

36:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  %37 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %38 unwind label %65

38:                                               ; preds = %36
  %39 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %37, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %40 unwind label %65

40:                                               ; preds = %38
  %41 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %39, ptr noundef nonnull align 4 dereferenceable(4) %8)
          to label %42 unwind label %65

42:                                               ; preds = %40
  %43 = load i32, ptr %6, align 4, !tbaa !8
  %44 = zext i32 %43 to i64
  %45 = call ptr @llvm.stacksave.p0()
  store ptr %45, ptr %9, align 8
  %46 = alloca %"struct.std::pair", i64 %44, align 16
  store i64 %44, ptr %10, align 8
  %47 = icmp eq i64 %44, 0
  br i1 %47, label %55, label %48

48:                                               ; preds = %42
  %49 = getelementptr inbounds %"struct.std::pair", ptr %46, i64 %44
  br label %50

50:                                               ; preds = %52, %48
  %51 = phi ptr [ %46, %48 ], [ %53, %52 ]
  invoke void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %51)
          to label %52 unwind label %65

52:                                               ; preds = %50
  %53 = getelementptr inbounds %"struct.std::pair", ptr %51, i64 1
  %54 = icmp eq ptr %53, %49
  br i1 %54, label %55, label %50

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

56:                                               ; preds = %80, %55
  %57 = load i32, ptr %11, align 4, !tbaa !8
  %58 = load i32, ptr %6, align 4, !tbaa !8
  %59 = icmp slt i32 %57, %58
  br i1 %59, label %69, label %60

60:                                               ; preds = %56
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %92

61:                                               ; preds = %0
  %62 = landingpad { ptr, i32 }
          cleanup
  %63 = extractvalue { ptr, i32 } %62, 0
  store ptr %63, ptr %4, align 8
  %64 = extractvalue { ptr, i32 } %62, 1
  store i32 %64, ptr %5, align 4
  br label %298

65:                                               ; preds = %50, %40, %38, %36
  %66 = landingpad { ptr, i32 }
          cleanup
  %67 = extractvalue { ptr, i32 } %66, 0
  store ptr %67, ptr %4, align 8
  %68 = extractvalue { ptr, i32 } %66, 1
  store i32 %68, ptr %5, align 4
  br label %297

69:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %70 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 4 dereferenceable(4) %12)
          to label %71 unwind label %83

71:                                               ; preds = %69
  %72 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %70, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %73 unwind label %83

73:                                               ; preds = %71
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %74 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
          to label %75 unwind label %87

75:                                               ; preds = %73
  store i64 %74, ptr %14, align 4
  %76 = load i32, ptr %11, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds %"struct.std::pair", ptr %46, i64 %77
  %79 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %78, ptr noundef nonnull align 4 dereferenceable(8) %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %80

80:                                               ; preds = %75
  %81 = load i32, ptr %11, align 4, !tbaa !8
  %82 = add nsw i32 %81, 1
  store i32 %82, ptr %11, align 4, !tbaa !8
  br label %56, !llvm.loop !11

83:                                               ; preds = %71, %69
  %84 = landingpad { ptr, i32 }
          cleanup
  %85 = extractvalue { ptr, i32 } %84, 0
  store ptr %85, ptr %4, align 8
  %86 = extractvalue { ptr, i32 } %84, 1
  store i32 %86, ptr %5, align 4
  br label %91

87:                                               ; preds = %73
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %4, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  br label %91

91:                                               ; preds = %87, %83
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %297

92:                                               ; preds = %60
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 0, ptr %15, align 4, !tbaa !8
  br label %93

93:                                               ; preds = %126, %92
  %94 = load i32, ptr %15, align 4, !tbaa !8
  %95 = load i32, ptr %7, align 4, !tbaa !8
  %96 = icmp slt i32 %94, %95
  br i1 %96, label %98, label %97

97:                                               ; preds = %93
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %130

98:                                               ; preds = %93
  call void @llvm.lifetime.start.p0(i64 1, ptr %16) #7
  %99 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %2, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %100 unwind label %112

100:                                              ; preds = %98
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  %101 = invoke ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56) @umap, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %102 unwind label %116

102:                                              ; preds = %100
  %103 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %17, i32 0, i32 0
  %104 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %103, i32 0, i32 0
  store ptr %101, ptr %104, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %105 = call ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @umap) #7
  %106 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %18, i32 0, i32 0
  %107 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %106, i32 0, i32 0
  store ptr %105, ptr %107, align 8
  %108 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKciELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %17, ptr noundef nonnull align 8 dereferenceable(8) %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br i1 %108, label %109, label %120

109:                                              ; preds = %102
  %110 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @umap, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %111 unwind label %112

111:                                              ; preds = %109
  store i32 1, ptr %110, align 4, !tbaa !8
  br label %125

112:                                              ; preds = %120, %109, %98
  %113 = landingpad { ptr, i32 }
          cleanup
  %114 = extractvalue { ptr, i32 } %113, 0
  store ptr %114, ptr %4, align 8
  %115 = extractvalue { ptr, i32 } %113, 1
  store i32 %115, ptr %5, align 4
  br label %129

116:                                              ; preds = %100
  %117 = landingpad { ptr, i32 }
          cleanup
  %118 = extractvalue { ptr, i32 } %117, 0
  store ptr %118, ptr %4, align 8
  %119 = extractvalue { ptr, i32 } %117, 1
  store i32 %119, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  br label %129

120:                                              ; preds = %102
  %121 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @umap, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %122 unwind label %112

122:                                              ; preds = %120
  %123 = load i32, ptr %121, align 4, !tbaa !8
  %124 = add nsw i32 %123, 1
  store i32 %124, ptr %121, align 4, !tbaa !8
  br label %125

125:                                              ; preds = %122, %111
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  br label %126

126:                                              ; preds = %125
  %127 = load i32, ptr %15, align 4, !tbaa !8
  %128 = add nsw i32 %127, 1
  store i32 %128, ptr %15, align 4, !tbaa !8
  br label %93, !llvm.loop !13

129:                                              ; preds = %116, %112
  call void @llvm.lifetime.end.p0(i64 1, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %297

130:                                              ; preds = %97
  store i64 1, ptr @dp, align 16, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #7
  store i32 0, ptr %19, align 4, !tbaa !8
  br label %131

131:                                              ; preds = %222, %130
  %132 = load i32, ptr %19, align 4, !tbaa !8
  %133 = load i32, ptr %8, align 4, !tbaa !8
  %134 = icmp sle i32 %132, %133
  br i1 %134, label %136, label %135

135:                                              ; preds = %131
  store i32 8, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #7
  br label %225

136:                                              ; preds = %131
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  store i32 0, ptr %21, align 4, !tbaa !8
  br label %137

137:                                              ; preds = %218, %136
  %138 = load i32, ptr %21, align 4, !tbaa !8
  %139 = load i32, ptr %6, align 4, !tbaa !8
  %140 = icmp slt i32 %138, %139
  br i1 %140, label %142, label %141

141:                                              ; preds = %137
  store i32 11, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  br label %221

142:                                              ; preds = %137
  %143 = load i32, ptr %21, align 4, !tbaa !8
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds %"struct.std::pair", ptr %46, i64 %144
  %146 = getelementptr inbounds %"struct.std::pair", ptr %145, i32 0, i32 0
  %147 = load i32, ptr %146, align 8, !tbaa !16
  %148 = load i32, ptr %19, align 4, !tbaa !8
  %149 = add nsw i32 %147, %148
  %150 = load i32, ptr %8, align 4, !tbaa !8
  %151 = icmp sgt i32 %149, %150
  br i1 %151, label %152, label %153

152:                                              ; preds = %142
  br label %218

153:                                              ; preds = %142
  %154 = load i32, ptr %21, align 4, !tbaa !8
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds %"struct.std::pair", ptr %46, i64 %155
  %157 = getelementptr inbounds %"struct.std::pair", ptr %156, i32 0, i32 0
  %158 = load i32, ptr %157, align 8, !tbaa !16
  %159 = load i32, ptr %19, align 4, !tbaa !8
  %160 = add nsw i32 %158, %159
  %161 = load i32, ptr %8, align 4, !tbaa !8
  %162 = icmp eq i32 %160, %161
  br i1 %162, label %163, label %188

163:                                              ; preds = %153
  %164 = load i32, ptr %21, align 4, !tbaa !8
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds %"struct.std::pair", ptr %46, i64 %165
  %167 = getelementptr inbounds %"struct.std::pair", ptr %166, i32 0, i32 1
  %168 = load i32, ptr %167, align 4, !tbaa !18
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [5005 x i64], ptr @r, i64 0, i64 %169
  %171 = load i64, ptr %170, align 8, !tbaa !14
  %172 = load i32, ptr %19, align 4, !tbaa !8
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [5005 x i64], ptr @dp, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !14
  %176 = add nsw i64 %171, %175
  %177 = load i64, ptr @MOD, align 8, !tbaa !14
  %178 = add nsw i64 %176, %177
  %179 = load i64, ptr @MOD, align 8, !tbaa !14
  %180 = srem i64 %178, %179
  %181 = load i32, ptr %21, align 4, !tbaa !8
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds %"struct.std::pair", ptr %46, i64 %182
  %184 = getelementptr inbounds %"struct.std::pair", ptr %183, i32 0, i32 1
  %185 = load i32, ptr %184, align 4, !tbaa !18
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [5005 x i64], ptr @r, i64 0, i64 %186
  store i64 %180, ptr %187, align 8, !tbaa !14
  br label %217

188:                                              ; preds = %153
  %189 = load i32, ptr %21, align 4, !tbaa !8
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds %"struct.std::pair", ptr %46, i64 %190
  %192 = getelementptr inbounds %"struct.std::pair", ptr %191, i32 0, i32 0
  %193 = load i32, ptr %192, align 8, !tbaa !16
  %194 = load i32, ptr %19, align 4, !tbaa !8
  %195 = add nsw i32 %193, %194
  %196 = sext i32 %195 to i64
  %197 = getelementptr inbounds [5005 x i64], ptr @dp, i64 0, i64 %196
  %198 = load i64, ptr %197, align 8, !tbaa !14
  %199 = load i32, ptr %19, align 4, !tbaa !8
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [5005 x i64], ptr @dp, i64 0, i64 %200
  %202 = load i64, ptr %201, align 8, !tbaa !14
  %203 = add nsw i64 %198, %202
  %204 = load i64, ptr @MOD, align 8, !tbaa !14
  %205 = add nsw i64 %203, %204
  %206 = load i64, ptr @MOD, align 8, !tbaa !14
  %207 = srem i64 %205, %206
  %208 = load i32, ptr %21, align 4, !tbaa !8
  %209 = sext i32 %208 to i64
  %210 = getelementptr inbounds %"struct.std::pair", ptr %46, i64 %209
  %211 = getelementptr inbounds %"struct.std::pair", ptr %210, i32 0, i32 0
  %212 = load i32, ptr %211, align 8, !tbaa !16
  %213 = load i32, ptr %19, align 4, !tbaa !8
  %214 = add nsw i32 %212, %213
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [5005 x i64], ptr @dp, i64 0, i64 %215
  store i64 %207, ptr %216, align 8, !tbaa !14
  br label %217

217:                                              ; preds = %188, %163
  br label %218

218:                                              ; preds = %217, %152
  %219 = load i32, ptr %21, align 4, !tbaa !8
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %21, align 4, !tbaa !8
  br label %137, !llvm.loop !19

221:                                              ; preds = %141
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %19, align 4, !tbaa !8
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %19, align 4, !tbaa !8
  br label %131, !llvm.loop !20

225:                                              ; preds = %135
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 1, ptr %22, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store ptr @umap, ptr %23, align 8, !tbaa !21
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  %226 = call ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) @umap) #7
  %227 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %24, i32 0, i32 0
  %228 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %227, i32 0, i32 0
  store ptr %226, ptr %228, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #7
  %229 = call ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @umap) #7
  %230 = getelementptr inbounds %"struct.std::__detail::_Node_iterator", ptr %25, i32 0, i32 0
  %231 = getelementptr inbounds %"struct.std::__detail::_Node_iterator_base", ptr %230, i32 0, i32 0
  store ptr %229, ptr %231, align 8
  br label %232

232:                                              ; preds = %281, %225
  %233 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKciELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %25) #7
  br i1 %233, label %235, label %234

234:                                              ; preds = %232
  store i32 14, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %283

235:                                              ; preds = %232
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %236 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKciELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %26, ptr align 4 %236, i64 8, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #7
  %237 = getelementptr inbounds %"struct.std::pair.2", ptr %26, i32 0, i32 1
  %238 = load i32, ptr %237, align 4, !tbaa !23
  store i32 %238, ptr %27, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  store i64 0, ptr %28, align 8, !tbaa !14
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #7
  store i32 0, ptr %29, align 4, !tbaa !8
  br label %239

239:                                              ; preds = %266, %235
  %240 = load i32, ptr %29, align 4, !tbaa !8
  %241 = load i32, ptr %6, align 4, !tbaa !8
  %242 = icmp sle i32 %240, %241
  br i1 %242, label %244, label %243

243:                                              ; preds = %239
  store i32 16, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  br label %273

244:                                              ; preds = %239
  %245 = load i32, ptr %29, align 4, !tbaa !8
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [5005 x i64], ptr @r, i64 0, i64 %246
  %248 = load i64, ptr %247, align 8, !tbaa !14
  %249 = icmp eq i64 %248, 0
  br i1 %249, label %250, label %251

250:                                              ; preds = %244
  br label %266

251:                                              ; preds = %244
  %252 = load i64, ptr %28, align 8, !tbaa !14
  %253 = load i32, ptr %29, align 4, !tbaa !8
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [5005 x i64], ptr @r, i64 0, i64 %254
  %256 = load i64, ptr %255, align 8, !tbaa !14
  %257 = trunc i64 %256 to i32
  %258 = load i32, ptr %27, align 4, !tbaa !8
  %259 = invoke noundef i64 @_Z3expii(i32 noundef %257, i32 noundef %258)
          to label %260 unwind label %269

260:                                              ; preds = %251
  %261 = add nsw i64 %252, %259
  %262 = load i64, ptr @MOD, align 8, !tbaa !14
  %263 = add nsw i64 %261, %262
  %264 = load i64, ptr @MOD, align 8, !tbaa !14
  %265 = srem i64 %263, %264
  store i64 %265, ptr %28, align 8, !tbaa !14
  br label %266

266:                                              ; preds = %260, %250
  %267 = load i32, ptr %29, align 4, !tbaa !8
  %268 = add nsw i32 %267, 1
  store i32 %268, ptr %29, align 4, !tbaa !8
  br label %239, !llvm.loop !25

269:                                              ; preds = %251
  %270 = landingpad { ptr, i32 }
          cleanup
  %271 = extractvalue { ptr, i32 } %270, 0
  store ptr %271, ptr %4, align 8
  %272 = extractvalue { ptr, i32 } %270, 1
  store i32 %272, ptr %5, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %296

273:                                              ; preds = %243
  %274 = load i64, ptr %22, align 8, !tbaa !14
  %275 = load i64, ptr %28, align 8, !tbaa !14
  %276 = mul nsw i64 %274, %275
  %277 = load i64, ptr @MOD, align 8, !tbaa !14
  %278 = add nsw i64 %276, %277
  %279 = load i64, ptr @MOD, align 8, !tbaa !14
  %280 = srem i64 %278, %279
  store i64 %280, ptr %22, align 8, !tbaa !14
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  br label %281

281:                                              ; preds = %273
  %282 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKciELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #7
  br label %232

283:                                              ; preds = %234
  %284 = load i64, ptr %22, align 8, !tbaa !14
  %285 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %284)
          to label %286 unwind label %292

286:                                              ; preds = %283
  %287 = load i64, ptr %22, align 8, !tbaa !14
  %288 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %3, i64 noundef %287)
          to label %289 unwind label %292

289:                                              ; preds = %286
  store i32 0, ptr %1, align 4
  store i32 1, ptr %20, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  %290 = load ptr, ptr %9, align 8
  call void @llvm.stackrestore.p0(ptr %290)
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #7
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #7
  %291 = load i32, ptr %1, align 4
  ret i32 %291

292:                                              ; preds = %286, %283
  %293 = landingpad { ptr, i32 }
          cleanup
  %294 = extractvalue { ptr, i32 } %293, 0
  store ptr %294, ptr %4, align 8
  %295 = extractvalue { ptr, i32 } %293, 1
  store i32 %295, ptr %5, align 4
  br label %296

296:                                              ; preds = %292, %269
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %297

297:                                              ; preds = %296, %129, %91, %65
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %3) #7
  br label %298

298:                                              ; preds = %297, %61
  call void @llvm.lifetime.end.p0(i64 512, ptr %3) #7
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %2) #7
  call void @llvm.lifetime.end.p0(i64 520, ptr %2) #7
  br label %299

299:                                              ; preds = %298
  %300 = load ptr, ptr %4, align 8
  %301 = load i32, ptr %5, align 4
  %302 = insertvalue { ptr, i32 } poison, ptr %300, 0
  %303 = insertvalue { ptr, i32 } %302, i32 %301, 1
  resume { ptr, i32 } %303
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) #4 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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: nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) #3

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 1 dereferenceable(1)) #0 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKciELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #4 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) #6

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #4 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !15, i64 0}
!15 = !{!"long long", !10, i64 0}
!16 = !{!17, !9, i64 0}
!17 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!18 = !{!17, !9, i64 4}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = !{!22, !22, i64 0}
!22 = !{!"any pointer", !10, i64 0}
!23 = !{!24, !9, i64 4}
!24 = !{!"_ZTSSt4pairIKciE", !10, i64 0, !9, i64 4}
!25 = distinct !{!25, !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::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"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::basic_ifstream" = type { %"class.std::basic_istream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_istream.base" = type { ptr, i64 }
%"class.std::basic_filebuf" = type { %"class.std::basic_streambuf", %union.pthread_mutex_t, %"class.std::__basic_file", i32, %struct.__mbstate_t, %struct.__mbstate_t, %struct.__mbstate_t, ptr, i64, i8, i8, i8, i8, ptr, ptr, i8, ptr, ptr, i64, ptr, ptr }
%"class.std::basic_streambuf" = type { ptr, ptr, ptr, ptr, ptr, ptr, ptr, %"class.std::locale" }
%union.pthread_mutex_t = type { %struct.__pthread_mutex_s }
%struct.__pthread_mutex_s = type { i32, i32, i32, i32, i32, i16, i16, %struct.__pthread_internal_list }
%struct.__pthread_internal_list = type { ptr, ptr }
%"class.std::__basic_file" = type <{ ptr, i8, [7 x i8] }>
%struct.__mbstate_t = type { i32, %union.anon }
%union.anon = type { i32 }
%"class.std::basic_ofstream" = type { %"class.std::basic_ostream.base", %"class.std::basic_filebuf", %"class.std::basic_ios" }
%"class.std::basic_ostream.base" = type { ptr }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::__detail::_Node_iterator" = type { %"struct.std::__detail::_Node_iterator_base" }
%"struct.std::__detail::_Node_iterator_base" = type { ptr }

@MOD = external dso_local local_unnamed_addr global i64, align 8
@dp = external dso_local local_unnamed_addr global [5005 x i64], align 16
@r = external dso_local local_unnamed_addr global [5005 x i64], align 16
@umap = external dso_local global %"class.std::unordered_map", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str = external hidden unnamed_addr constant [10 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_Z3expii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca %"class.std::basic_ifstream", align 8
  %2 = alloca %"class.std::basic_ofstream", align 8
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca i8, align 1
  %10 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %11 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %12 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %13 = alloca %"struct.std::__detail::_Node_iterator", align 8
  %14 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 520, ptr nonnull %1) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256) %1, ptr noundef nonnull @.str, i32 noundef 8)
  call void @llvm.lifetime.start.p0(i64 512, ptr nonnull %2) #6
  invoke void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248) %2, ptr noundef nonnull @.str.2, i32 noundef 16)
          to label %20 unwind label %42

20:                                               ; preds = %0
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %21 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
          to label %22 unwind label %44

22:                                               ; preds = %20
  %23 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %4)
          to label %24 unwind label %44

24:                                               ; preds = %22
  %25 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 4 dereferenceable(4) %5)
          to label %26 unwind label %44

26:                                               ; preds = %24
  %27 = load i32, ptr %3, align 4, !tbaa !8
  %28 = zext i32 %27 to i64
  %29 = call ptr @llvm.stacksave.p0()
  %30 = alloca %"struct.std::pair", i64 %28, align 16
  %31 = icmp eq i32 %27, 0
  br i1 %31, label %.loopexit, label %32

32:                                               ; preds = %26
  %33 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %28
  br label %34

34:                                               ; preds = %34, %32
  %35 = phi ptr [ %30, %32 ], [ %36, %34 ]
  call void @_ZNSt4pairIiiEC2IiiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 4 dereferenceable(8) %35)
  %36 = getelementptr inbounds i8, ptr %35, i64 8
  %37 = icmp eq ptr %36, %33
  br i1 %37, label %.loopexit, label %34

.loopexit:                                        ; preds = %34, %26
  %38 = load i32, ptr %3, align 4, !tbaa !8
  %39 = icmp sgt i32 %38, 0
  br i1 %39, label %.lr.ph, label %.preheader59

.preheader59:                                     ; preds = %51, %.loopexit
  %40 = load i32, ptr %4, align 4, !tbaa !8
  %41 = icmp sgt i32 %40, 0
  br i1 %41, label %.lr.ph64, label %._crit_edge

42:                                               ; preds = %0
  %43 = landingpad { ptr, i32 }
          cleanup
  br label %145

44:                                               ; preds = %24, %22, %20
  %45 = landingpad { ptr, i32 }
          cleanup
  br label %144

.lr.ph:                                           ; preds = %.loopexit, %51
  %indvars.iv = phi i64 [ %indvars.iv.next, %51 ], [ 0, %.loopexit ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #6
  %46 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 4 dereferenceable(4) %6)
          to label %47 unwind label %57

47:                                               ; preds = %.lr.ph
  %48 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %49 unwind label %57

49:                                               ; preds = %47
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %50 = invoke i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
          to label %51 unwind label %59

51:                                               ; preds = %49
  store i64 %50, ptr %8, align 8
  %52 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %indvars.iv
  %53 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %52, ptr noundef nonnull align 4 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %54 = load i32, ptr %3, align 4, !tbaa !8
  %55 = sext i32 %54 to i64
  %56 = icmp slt i64 %indvars.iv.next, %55
  br i1 %56, label %.lr.ph, label %.preheader59, !llvm.loop !11

57:                                               ; preds = %47, %.lr.ph
  %58 = landingpad { ptr, i32 }
          cleanup
  br label %61

59:                                               ; preds = %49
  %60 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  br label %61

61:                                               ; preds = %59, %57
  %.pn55 = phi { ptr, i32 } [ %60, %59 ], [ %58, %57 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  br label %144

._crit_edge:                                      ; preds = %105, %.preheader59
  store i64 1, ptr @dp, align 16, !tbaa !13
  %62 = load i32, ptr %5, align 4, !tbaa !8
  %.not68 = icmp slt i32 %62, 0
  br i1 %.not68, label %._crit_edge70, label %.preheader.lr.ph

.preheader.lr.ph:                                 ; preds = %._crit_edge
  %63 = load i32, ptr %3, align 4, !tbaa !8
  %64 = icmp sgt i32 %63, 0
  %65 = load i64, ptr @MOD, align 8
  br i1 %64, label %.preheader.us.preheader, label %._crit_edge70

.preheader.us.preheader:                          ; preds = %.preheader.lr.ph
  %66 = add nuw i32 %62, 1
  %wide.trip.count90 = zext i32 %66 to i64
  %wide.trip.count = zext nneg i32 %63 to i64
  br label %.preheader.us

.preheader.us:                                    ; preds = %.preheader.us.preheader, %._crit_edge67.us
  %indvars.iv87 = phi i64 [ 0, %.preheader.us.preheader ], [ %indvars.iv.next88, %._crit_edge67.us ]
  %67 = getelementptr inbounds [5005 x i64], ptr @dp, i64 0, i64 %indvars.iv87
  %68 = trunc nuw nsw i64 %indvars.iv87 to i32
  br label %69

69:                                               ; preds = %.preheader.us, %86
  %indvars.iv84 = phi i64 [ 0, %.preheader.us ], [ %indvars.iv.next85, %86 ]
  %70 = getelementptr inbounds %"struct.std::pair", ptr %30, i64 %indvars.iv84
  %71 = load i32, ptr %70, align 8, !tbaa !15
  %72 = add nsw i32 %71, %68
  %73 = icmp sgt i32 %72, %62
  br i1 %73, label %86, label %74

74:                                               ; preds = %69
  %75 = icmp eq i32 %72, %62
  br i1 %75, label %76, label %.sink.split

76:                                               ; preds = %74
  %77 = getelementptr inbounds i8, ptr %70, i64 4
  %78 = load i32, ptr %77, align 4, !tbaa !17
  br label %.sink.split

.sink.split:                                      ; preds = %74, %76
  %.sink = phi i32 [ %78, %76 ], [ %72, %74 ]
  %r.sink = phi ptr [ @r, %76 ], [ @dp, %74 ]
  %79 = sext i32 %.sink to i64
  %80 = getelementptr inbounds [5005 x i64], ptr %r.sink, i64 0, i64 %79
  %81 = load i64, ptr %80, align 8, !tbaa !13
  %82 = load i64, ptr %67, align 8, !tbaa !13
  %83 = add nsw i64 %82, %81
  %84 = add nsw i64 %83, %65
  %85 = srem i64 %84, %65
  store i64 %85, ptr %80, align 8, !tbaa !13
  br label %86

86:                                               ; preds = %.sink.split, %69
  %indvars.iv.next85 = add nuw nsw i64 %indvars.iv84, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next85, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge67.us, label %69, !llvm.loop !18

._crit_edge67.us:                                 ; preds = %86
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %exitcond91.not = icmp eq i64 %indvars.iv.next88, %wide.trip.count90
  br i1 %exitcond91.not, label %._crit_edge70, label %.preheader.us, !llvm.loop !19

.lr.ph64:                                         ; preds = %.preheader59, %105
  %.04663 = phi i32 [ %106, %105 ], [ 0, %.preheader59 ]
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %9) #6
  %87 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16) %1, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %88 unwind label %96

88:                                               ; preds = %.lr.ph64
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  %89 = invoke ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56) @umap, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %90 unwind label %98

90:                                               ; preds = %88
  store ptr %89, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #6
  %91 = call ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @umap) #6
  store ptr %91, ptr %11, align 8
  %92 = call noundef zeroext i1 @_ZNSt8__detaileqERKNS_19_Node_iterator_baseISt4pairIKciELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br i1 %92, label %93, label %100

93:                                               ; preds = %90
  %94 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @umap, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %95 unwind label %96

95:                                               ; preds = %93
  store i32 1, ptr %94, align 4, !tbaa !8
  br label %105

96:                                               ; preds = %100, %93, %.lr.ph64
  %97 = landingpad { ptr, i32 }
          cleanup
  br label %109

98:                                               ; preds = %88
  %99 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %109

100:                                              ; preds = %90
  %101 = invoke noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56) @umap, ptr noundef nonnull align 1 dereferenceable(1) %9)
          to label %102 unwind label %96

102:                                              ; preds = %100
  %103 = load i32, ptr %101, align 4, !tbaa !8
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %101, align 4, !tbaa !8
  br label %105

105:                                              ; preds = %102, %95
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #6
  %106 = add nuw nsw i32 %.04663, 1
  %107 = load i32, ptr %4, align 4, !tbaa !8
  %108 = icmp slt i32 %106, %107
  br i1 %108, label %.lr.ph64, label %._crit_edge, !llvm.loop !20

109:                                              ; preds = %98, %96
  %.pn53 = phi { ptr, i32 } [ %97, %96 ], [ %99, %98 ]
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %9) #6
  br label %144

._crit_edge70:                                    ; preds = %._crit_edge67.us, %.preheader.lr.ph, %._crit_edge
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %12) #6
  %110 = call ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE5beginEv(ptr noundef nonnull align 8 dereferenceable(56) @umap) #6
  store ptr %110, ptr %12, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %13) #6
  %111 = call ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE3endEv(ptr noundef nonnull align 8 dereferenceable(56) @umap) #6
  store ptr %111, ptr %13, align 8
  %112 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKciELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  br i1 %112, label %.lr.ph79, label %._crit_edge80

._crit_edge80:                                    ; preds = %._crit_edge76, %._crit_edge70
  %.043.lcssa = phi i64 [ 1, %._crit_edge70 ], [ %119, %._crit_edge76 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  %113 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.043.lcssa)
          to label %139 unwind label %142

.lr.ph79:                                         ; preds = %._crit_edge70, %._crit_edge76
  %.04377 = phi i64 [ %119, %._crit_edge76 ], [ 1, %._crit_edge70 ]
  %114 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNKSt8__detail14_Node_iteratorISt4pairIKciELb0ELb0EEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %114, i64 4
  %.sroa.4.0.copyload = load i32, ptr %.sroa.4.0..sroa_idx, align 4
  %115 = load i32, ptr %3, align 4, !tbaa !8
  %.not5171 = icmp slt i32 %115, 0
  br i1 %.not5171, label %._crit_edge76, label %.lr.ph75

._crit_edge76:                                    ; preds = %134, %.lr.ph79
  %.034.lcssa = phi i64 [ 0, %.lr.ph79 ], [ %.1, %134 ]
  %116 = mul nsw i64 %.034.lcssa, %.04377
  %117 = load i64, ptr @MOD, align 8, !tbaa !13
  %118 = add nsw i64 %117, %116
  %119 = srem i64 %118, %117
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt8__detail14_Node_iteratorISt4pairIKciELb0ELb0EEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #6
  %121 = call noundef zeroext i1 @_ZNSt8__detailneERKNS_19_Node_iterator_baseISt4pairIKciELb0EEES6_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #6
  br i1 %121, label %.lr.ph79, label %._crit_edge80

.lr.ph75:                                         ; preds = %.lr.ph79, %134
  %122 = phi i32 [ %135, %134 ], [ %115, %.lr.ph79 ]
  %indvars.iv92 = phi i64 [ %indvars.iv.next93, %134 ], [ 0, %.lr.ph79 ]
  %.03472 = phi i64 [ %.1, %134 ], [ 0, %.lr.ph79 ]
  %123 = getelementptr inbounds [5005 x i64], ptr @r, i64 0, i64 %indvars.iv92
  %124 = load i64, ptr %123, align 8, !tbaa !13
  %125 = icmp eq i64 %124, 0
  br i1 %125, label %134, label %126

126:                                              ; preds = %.lr.ph75
  %127 = trunc i64 %124 to i32
  %128 = invoke noundef i64 @_Z3expii(i32 noundef %127, i32 noundef %.sroa.4.0.copyload)
          to label %129 unwind label %137

129:                                              ; preds = %126
  %130 = add nsw i64 %128, %.03472
  %131 = load i64, ptr @MOD, align 8, !tbaa !13
  %132 = add nsw i64 %130, %131
  %133 = srem i64 %132, %131
  %.pre = load i32, ptr %3, align 4, !tbaa !8
  br label %134

134:                                              ; preds = %.lr.ph75, %129
  %135 = phi i32 [ %122, %.lr.ph75 ], [ %.pre, %129 ]
  %.1 = phi i64 [ %.03472, %.lr.ph75 ], [ %133, %129 ]
  %indvars.iv.next93 = add nuw nsw i64 %indvars.iv92, 1
  %136 = sext i32 %135 to i64
  %.not51.not = icmp slt i64 %indvars.iv92, %136
  br i1 %.not51.not, label %.lr.ph75, label %._crit_edge76, !llvm.loop !21

137:                                              ; preds = %126
  %138 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %12) #6
  br label %144

139:                                              ; preds = %._crit_edge80
  %140 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) %2, i64 noundef %.043.lcssa)
          to label %141 unwind label %142

141:                                              ; preds = %139
  call void @llvm.stackrestore.p0(ptr %29)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #6
  ret i32 0

142:                                              ; preds = %139, %._crit_edge80
  %143 = landingpad { ptr, i32 }
          cleanup
  br label %144

144:                                              ; preds = %137, %142, %109, %61, %44
  %.pn55.pn = phi { ptr, i32 } [ %.pn55, %61 ], [ %.pn53, %109 ], [ %45, %44 ], [ %138, %137 ], [ %143, %142 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248) %2) #6
  br label %145

145:                                              ; preds = %144, %42
  %.pn55.pn.pn = phi { ptr, i32 } [ %.pn55.pn, %144 ], [ %43, %42 ]
  call void @llvm.lifetime.end.p0(i64 512, ptr nonnull %2) #6
  call void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256) %1) #6
  call void @llvm.lifetime.end.p0(i64 520, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn55.pn.pn
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #3

; Function Attrs: mustprogress nounwind uwtable
declare noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264), ptr noundef) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(256), ptr noundef, i32 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEEC1EPKcSt13_Ios_Openmode(ptr noundef nonnull align 8 dereferenceable(248), ptr noundef, i32 noundef) unnamed_addr #0 align 2

declare i32 @__gxx_personality_v0(...)

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 nocallback nofree nosync nounwind willreturn
declare ptr @llvm.stacksave.p0() #5

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

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

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

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZStrsIcSt11char_traitsIcEERSt13basic_istreamIT_T0_ES6_RS3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #3

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEE4findERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIciSt4hashIcESt8equal_toIcESaISt4pairIKciEEEixERS5_(ptr noundef nonnull align 8 dereferenceable(56), ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #0 align 2

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ofstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(248)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt14basic_ifstreamIcSt11char_traitsIcEED1Ev(ptr noundef nonnull align 8 dereferenceable(256)) unnamed_addr #4 align 2

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long long", !10, i64 0}
!15 = !{!16, !9, i64 0}
!16 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!17 = !{!16, !9, i64 4}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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