; LLVM IR from eyangch/competitive-programming :: Codeforces/1559 (e)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<long long, bool>, std::allocator<std::pair<long long, bool>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, bool>, std::allocator<std::pair<long long, bool>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, bool>, std::allocator<std::pair<long long, bool>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, bool>, std::allocator<std::pair<long long, bool>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair" = type <{ i64, i8, [7 x i8] }>

@MOD = external dso_local global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@L = external dso_local global [50 x i64], align 16
@R = external dso_local global [50 x i64], align 16
@dp = external dso_local global [51 x [100001 x i64]], align 16
@sv = external dso_local global [100001 x i8], align 16
@pr = external dso_local global %"class.std::vector", align 8
@nm = external dso_local global %"class.std::vector.0", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

29:                                               ; preds = %55, %0
  %30 = load i64, ptr %2, align 8, !tbaa !8
  %31 = icmp slt i64 %30, 100001
  br i1 %31, label %33, label %32

32:                                               ; preds = %29
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #8
  br label %58

33:                                               ; preds = %29
  %34 = load i64, ptr %2, align 8, !tbaa !8
  %35 = getelementptr inbounds [100001 x i8], ptr @sv, i64 0, i64 %34
  %36 = load i8, ptr %35, align 1, !tbaa !11, !range !13, !noundef !14
  %37 = trunc i8 %36 to i1
  br i1 %37, label %38, label %39

38:                                               ; preds = %33
  br label %55

39:                                               ; preds = %33
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #8
  store i64 2, ptr %4, align 8, !tbaa !8
  br label %40

40:                                               ; preds = %51, %39
  %41 = load i64, ptr %2, align 8, !tbaa !8
  %42 = load i64, ptr %4, align 8, !tbaa !8
  %43 = mul nsw i64 %41, %42
  %44 = icmp slt i64 %43, 100001
  br i1 %44, label %46, label %45

45:                                               ; preds = %40
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #8
  br label %54

46:                                               ; preds = %40
  %47 = load i64, ptr %2, align 8, !tbaa !8
  %48 = load i64, ptr %4, align 8, !tbaa !8
  %49 = mul nsw i64 %47, %48
  %50 = getelementptr inbounds [100001 x i8], ptr @sv, i64 0, i64 %49
  store i8 1, ptr %50, align 1, !tbaa !11
  br label %51

51:                                               ; preds = %46
  %52 = load i64, ptr %4, align 8, !tbaa !8
  %53 = add nsw i64 %52, 1
  store i64 %53, ptr %4, align 8, !tbaa !8
  br label %40, !llvm.loop !15

54:                                               ; preds = %45
  br label %55

55:                                               ; preds = %54, %38
  %56 = load i64, ptr %2, align 8, !tbaa !8
  %57 = add nsw i64 %56, 1
  store i64 %57, ptr %2, align 8, !tbaa !8
  br label %29, !llvm.loop !17

58:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #8
  store i64 1, ptr %5, align 8, !tbaa !8
  br label %59

59:                                               ; preds = %70, %58
  %60 = load i64, ptr %5, align 8, !tbaa !8
  %61 = icmp slt i64 %60, 100001
  br i1 %61, label %63, label %62

62:                                               ; preds = %59
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #8
  br label %73

63:                                               ; preds = %59
  %64 = load i64, ptr %5, align 8, !tbaa !8
  %65 = getelementptr inbounds [100001 x i8], ptr @sv, i64 0, i64 %64
  %66 = load i8, ptr %65, align 1, !tbaa !11, !range !13, !noundef !14
  %67 = trunc i8 %66 to i1
  br i1 %67, label %69, label %68

68:                                               ; preds = %63
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @pr, ptr noundef nonnull align 8 dereferenceable(8) %5)
  br label %69

69:                                               ; preds = %68, %63
  br label %70

70:                                               ; preds = %69
  %71 = load i64, ptr %5, align 8, !tbaa !8
  %72 = add nsw i64 %71, 1
  store i64 %72, ptr %5, align 8, !tbaa !8
  br label %59, !llvm.loop !18

73:                                               ; preds = %62
  %74 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %74, ptr noundef nonnull align 8 dereferenceable(8) @M)
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #8
  store i64 0, ptr %6, align 8, !tbaa !8
  br label %76

76:                                               ; preds = %88, %73
  %77 = load i64, ptr %6, align 8, !tbaa !8
  %78 = load i64, ptr @N, align 8, !tbaa !8
  %79 = icmp slt i64 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %76
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #8
  br label %91

81:                                               ; preds = %76
  %82 = load i64, ptr %6, align 8, !tbaa !8
  %83 = getelementptr inbounds [50 x i64], ptr @L, i64 0, i64 %82
  %84 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %83)
  %85 = load i64, ptr %6, align 8, !tbaa !8
  %86 = getelementptr inbounds [50 x i64], ptr @R, i64 0, i64 %85
  %87 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %84, ptr noundef nonnull align 8 dereferenceable(8) %86)
  br label %88

88:                                               ; preds = %81
  %89 = load i64, ptr %6, align 8, !tbaa !8
  %90 = add nsw i64 %89, 1
  store i64 %90, ptr %6, align 8, !tbaa !8
  br label %76, !llvm.loop !19

91:                                               ; preds = %80
  call void @_Z3dfsxxx(i64 noundef 1, i64 noundef 0, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #8
  store i64 0, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #8
  store ptr @nm, ptr %8, align 8, !tbaa !20
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #8
  %92 = call ptr @_ZNSt6vectorISt4pairIxbESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @nm) #8
  %93 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %92, ptr %93, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #8
  %94 = call ptr @_ZNSt6vectorISt4pairIxbESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @nm) #8
  %95 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  br label %96

96:                                               ; preds = %282, %91
  %97 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxbESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #8
  br i1 %97, label %99, label %98

98:                                               ; preds = %96
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #8
  br label %284

99:                                               ; preds = %96
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #8
  %100 = call noundef nonnull align 8 dereferenceable(9) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxbESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %11, ptr align 8 %100, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #8
  %101 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 0
  %102 = load i64, ptr %101, align 8, !tbaa !22
  store i64 %102, ptr %12, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 1, ptr %13) #8
  %103 = getelementptr inbounds %"struct.std::pair", ptr %11, i32 0, i32 1
  %104 = load i8, ptr %103, align 8, !tbaa !24, !range !13, !noundef !14
  %105 = trunc i8 %104 to i1
  %106 = zext i1 %105 to i8
  store i8 %106, ptr %13, align 1, !tbaa !11
  store i64 1, ptr @dp, align 16, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #8
  store i64 0, ptr %14, align 8, !tbaa !8
  br label %107

107:                                              ; preds = %242, %99
  %108 = load i64, ptr %14, align 8, !tbaa !8
  %109 = load i64, ptr @N, align 8, !tbaa !8
  %110 = icmp slt i64 %108, %109
  br i1 %110, label %112, label %111

111:                                              ; preds = %107
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #8
  br label %245

112:                                              ; preds = %107
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #8
  %113 = load i64, ptr %14, align 8, !tbaa !8
  %114 = getelementptr inbounds [50 x i64], ptr @L, i64 0, i64 %113
  %115 = load i64, ptr %114, align 8, !tbaa !8
  %116 = load i64, ptr %12, align 8, !tbaa !8
  %117 = sdiv i64 %115, %116
  %118 = load i64, ptr %14, align 8, !tbaa !8
  %119 = getelementptr inbounds [50 x i64], ptr @L, i64 0, i64 %118
  %120 = load i64, ptr %119, align 8, !tbaa !8
  %121 = load i64, ptr %12, align 8, !tbaa !8
  %122 = srem i64 %120, %121
  %123 = icmp ne i64 %122, 0
  %124 = zext i1 %123 to i64
  %125 = add nsw i64 %117, %124
  store i64 %125, ptr %15, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #8
  %126 = load i64, ptr %14, align 8, !tbaa !8
  %127 = getelementptr inbounds [50 x i64], ptr @R, i64 0, i64 %126
  %128 = load i64, ptr %127, align 8, !tbaa !8
  %129 = load i64, ptr %12, align 8, !tbaa !8
  %130 = sdiv i64 %128, %129
  store i64 %130, ptr %16, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #8
  store i64 0, ptr %17, align 8, !tbaa !8
  br label %131

131:                                              ; preds = %144, %112
  %132 = load i64, ptr %17, align 8, !tbaa !8
  %133 = load i64, ptr @M, align 8, !tbaa !8
  %134 = load i64, ptr %12, align 8, !tbaa !8
  %135 = sdiv i64 %133, %134
  %136 = icmp sle i64 %132, %135
  br i1 %136, label %138, label %137

137:                                              ; preds = %131
  store i32 19, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #8
  br label %147

138:                                              ; preds = %131
  %139 = load i64, ptr %14, align 8, !tbaa !8
  %140 = add nsw i64 %139, 1
  %141 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %140
  %142 = load i64, ptr %17, align 8, !tbaa !8
  %143 = getelementptr inbounds [100001 x i64], ptr %141, i64 0, i64 %142
  store i64 0, ptr %143, align 8, !tbaa !8
  br label %144

144:                                              ; preds = %138
  %145 = load i64, ptr %17, align 8, !tbaa !8
  %146 = add nsw i64 %145, 1
  store i64 %146, ptr %17, align 8, !tbaa !8
  br label %131, !llvm.loop !25

147:                                              ; preds = %137
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  store i64 0, ptr %18, align 8, !tbaa !8
  br label %148

148:                                              ; preds = %204, %147
  %149 = load i64, ptr %18, align 8, !tbaa !8
  %150 = load i64, ptr @M, align 8, !tbaa !8
  %151 = load i64, ptr %12, align 8, !tbaa !8
  %152 = sdiv i64 %150, %151
  %153 = icmp sle i64 %149, %152
  br i1 %153, label %155, label %154

154:                                              ; preds = %148
  store i32 22, ptr %3, align 4
  br label %207

155:                                              ; preds = %148
  %156 = load i64, ptr %18, align 8, !tbaa !8
  %157 = load i64, ptr %15, align 8, !tbaa !8
  %158 = add nsw i64 %156, %157
  %159 = load i64, ptr @M, align 8, !tbaa !8
  %160 = load i64, ptr %12, align 8, !tbaa !8
  %161 = sdiv i64 %159, %160
  %162 = icmp sgt i64 %158, %161
  br i1 %162, label %163, label %164

163:                                              ; preds = %155
  store i32 22, ptr %3, align 4
  br label %207

164:                                              ; preds = %155
  %165 = load i64, ptr %14, align 8, !tbaa !8
  %166 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %165
  %167 = load i64, ptr %18, align 8, !tbaa !8
  %168 = getelementptr inbounds [100001 x i64], ptr %166, i64 0, i64 %167
  %169 = load i64, ptr %168, align 8, !tbaa !8
  %170 = load i64, ptr %14, align 8, !tbaa !8
  %171 = add nsw i64 %170, 1
  %172 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %171
  %173 = load i64, ptr %18, align 8, !tbaa !8
  %174 = load i64, ptr %15, align 8, !tbaa !8
  %175 = add nsw i64 %173, %174
  %176 = getelementptr inbounds [100001 x i64], ptr %172, i64 0, i64 %175
  %177 = load i64, ptr %176, align 8, !tbaa !8
  %178 = add nsw i64 %177, %169
  store i64 %178, ptr %176, align 8, !tbaa !8
  %179 = load i64, ptr %18, align 8, !tbaa !8
  %180 = load i64, ptr %16, align 8, !tbaa !8
  %181 = add nsw i64 %179, %180
  %182 = add nsw i64 %181, 1
  %183 = load i64, ptr @M, align 8, !tbaa !8
  %184 = load i64, ptr %12, align 8, !tbaa !8
  %185 = sdiv i64 %183, %184
  %186 = icmp sle i64 %182, %185
  br i1 %186, label %187, label %203

187:                                              ; preds = %164
  %188 = load i64, ptr %14, align 8, !tbaa !8
  %189 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %188
  %190 = load i64, ptr %18, align 8, !tbaa !8
  %191 = getelementptr inbounds [100001 x i64], ptr %189, i64 0, i64 %190
  %192 = load i64, ptr %191, align 8, !tbaa !8
  %193 = load i64, ptr %14, align 8, !tbaa !8
  %194 = add nsw i64 %193, 1
  %195 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %194
  %196 = load i64, ptr %18, align 8, !tbaa !8
  %197 = load i64, ptr %16, align 8, !tbaa !8
  %198 = add nsw i64 %196, %197
  %199 = add nsw i64 %198, 1
  %200 = getelementptr inbounds [100001 x i64], ptr %195, i64 0, i64 %199
  %201 = load i64, ptr %200, align 8, !tbaa !8
  %202 = sub nsw i64 %201, %192
  store i64 %202, ptr %200, align 8, !tbaa !8
  br label %203

203:                                              ; preds = %187, %164
  br label %204

204:                                              ; preds = %203
  %205 = load i64, ptr %18, align 8, !tbaa !8
  %206 = add nsw i64 %205, 1
  store i64 %206, ptr %18, align 8, !tbaa !8
  br label %148, !llvm.loop !26

207:                                              ; preds = %163, %154
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %208

208:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  store i64 0, ptr %19, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #8
  store i64 1, ptr %20, align 8, !tbaa !8
  br label %209

209:                                              ; preds = %238, %208
  %210 = load i64, ptr %20, align 8, !tbaa !8
  %211 = load i64, ptr @M, align 8, !tbaa !8
  %212 = load i64, ptr %12, align 8, !tbaa !8
  %213 = sdiv i64 %211, %212
  %214 = icmp sle i64 %210, %213
  br i1 %214, label %216, label %215

215:                                              ; preds = %209
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #8
  br label %241

216:                                              ; preds = %209
  %217 = load i64, ptr %14, align 8, !tbaa !8
  %218 = add nsw i64 %217, 1
  %219 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %218
  %220 = load i64, ptr %20, align 8, !tbaa !8
  %221 = getelementptr inbounds [100001 x i64], ptr %219, i64 0, i64 %220
  %222 = load i64, ptr %221, align 8, !tbaa !8
  %223 = load i64, ptr %14, align 8, !tbaa !8
  %224 = add nsw i64 %223, 1
  %225 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %224
  %226 = load i64, ptr %20, align 8, !tbaa !8
  %227 = sub nsw i64 %226, 1
  %228 = getelementptr inbounds [100001 x i64], ptr %225, i64 0, i64 %227
  %229 = load i64, ptr %228, align 8, !tbaa !8
  %230 = add nsw i64 %222, %229
  %231 = load i64, ptr @MOD, align 8, !tbaa !8
  %232 = srem i64 %230, %231
  %233 = load i64, ptr %14, align 8, !tbaa !8
  %234 = add nsw i64 %233, 1
  %235 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %234
  %236 = load i64, ptr %20, align 8, !tbaa !8
  %237 = getelementptr inbounds [100001 x i64], ptr %235, i64 0, i64 %236
  store i64 %232, ptr %237, align 8, !tbaa !8
  br label %238

238:                                              ; preds = %216
  %239 = load i64, ptr %20, align 8, !tbaa !8
  %240 = add nsw i64 %239, 1
  store i64 %240, ptr %20, align 8, !tbaa !8
  br label %209, !llvm.loop !27

241:                                              ; preds = %215
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #8
  br label %242

242:                                              ; preds = %241
  %243 = load i64, ptr %14, align 8, !tbaa !8
  %244 = add nsw i64 %243, 1
  store i64 %244, ptr %14, align 8, !tbaa !8
  br label %107, !llvm.loop !28

245:                                              ; preds = %111
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #8
  store i64 0, ptr %21, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #8
  store i64 0, ptr %22, align 8, !tbaa !8
  br label %246

246:                                              ; preds = %263, %245
  %247 = load i64, ptr %22, align 8, !tbaa !8
  %248 = load i64, ptr @M, align 8, !tbaa !8
  %249 = load i64, ptr %12, align 8, !tbaa !8
  %250 = sdiv i64 %248, %249
  %251 = icmp sle i64 %247, %250
  br i1 %251, label %253, label %252

252:                                              ; preds = %246
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #8
  br label %266

253:                                              ; preds = %246
  %254 = load i64, ptr %21, align 8, !tbaa !8
  %255 = load i64, ptr @N, align 8, !tbaa !8
  %256 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %255
  %257 = load i64, ptr %22, align 8, !tbaa !8
  %258 = getelementptr inbounds [100001 x i64], ptr %256, i64 0, i64 %257
  %259 = load i64, ptr %258, align 8, !tbaa !8
  %260 = add nsw i64 %254, %259
  %261 = load i64, ptr @MOD, align 8, !tbaa !8
  %262 = srem i64 %260, %261
  store i64 %262, ptr %21, align 8, !tbaa !8
  br label %263

263:                                              ; preds = %253
  %264 = load i64, ptr %22, align 8, !tbaa !8
  %265 = add nsw i64 %264, 1
  store i64 %265, ptr %22, align 8, !tbaa !8
  br label %246, !llvm.loop !29

266:                                              ; preds = %252
  %267 = load i64, ptr %7, align 8, !tbaa !8
  %268 = load i8, ptr %13, align 1, !tbaa !11, !range !13, !noundef !14
  %269 = trunc i8 %268 to i1
  %270 = zext i1 %269 to i64
  %271 = select i1 %269, i32 -1, i32 1
  %272 = sext i32 %271 to i64
  %273 = load i64, ptr %21, align 8, !tbaa !8
  %274 = mul nsw i64 %272, %273
  %275 = add nsw i64 %267, %274
  %276 = load i64, ptr @MOD, align 8, !tbaa !8
  %277 = srem i64 %275, %276
  %278 = load i64, ptr @MOD, align 8, !tbaa !8
  %279 = add nsw i64 %277, %278
  %280 = load i64, ptr @MOD, align 8, !tbaa !8
  %281 = srem i64 %279, %280
  store i64 %281, ptr %7, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #8
  br label %282

282:                                              ; preds = %266
  %283 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxbESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #8
  br label %96

284:                                              ; preds = %98
  %285 = load i64, ptr %7, align 8, !tbaa !8
  %286 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %285)
  %287 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %286, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #8
  %288 = load i32, ptr %1, align 4
  ret i32 %288
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) #0 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)) #0 align 2

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(9) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxbESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 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 @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxbESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #7

; 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

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

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::pair<long long, bool>, std::allocator<std::pair<long long, bool>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<long long, bool>, std::allocator<std::pair<long long, bool>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<long long, bool>, std::allocator<std::pair<long long, bool>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<long long, bool>, std::allocator<std::pair<long long, bool>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@MOD = external dso_local local_unnamed_addr global i64, align 8
@N = external dso_local global i64, align 8
@M = external dso_local global i64, align 8
@L = external dso_local global [50 x i64], align 16
@R = external dso_local global [50 x i64], align 16
@dp = external dso_local local_unnamed_addr global [51 x [100001 x i64]], align 16
@sv = external dso_local local_unnamed_addr global [100001 x i8], align 16
@pr = external dso_local global %"class.std::vector", align 8
@nm = external dso_local global %"class.std::vector.0", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z3dfsxxx(i64 noundef, i64 noundef, i64 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 {
  %1 = alloca i64, align 8
  %2 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %3 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %4 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %5 = getelementptr i8, ptr %4, i64 -24
  %6 = load i64, ptr %5, align 8
  %7 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %6
  %8 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %7, ptr noundef null)
  %9 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  br label %11

10:                                               ; preds = %.loopexit
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #8
  store i64 1, ptr %1, align 8, !tbaa !8
  br label %28

11:                                               ; preds = %0, %.loopexit
  %.06585 = phi i64 [ 2, %0 ], [ %22, %.loopexit ]
  %12 = getelementptr inbounds [100001 x i8], ptr @sv, i64 0, i64 %.06585
  %13 = load i8, ptr %12, align 1, !tbaa !11, !range !13, !noundef !14
  %14 = trunc nuw i8 %13 to i1
  %15 = icmp ugt i64 %.06585, 50000
  %or.cond.not = or i1 %15, %14
  br i1 %or.cond.not, label %.loopexit, label %.lr.ph.preheader

.lr.ph.preheader:                                 ; preds = %11
  %16 = shl nuw nsw i64 %.06585, 1
  br label %.lr.ph

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %17 = phi i64 [ %20, %.lr.ph ], [ %16, %.lr.ph.preheader ]
  %.06884 = phi i64 [ %19, %.lr.ph ], [ 2, %.lr.ph.preheader ]
  %18 = getelementptr inbounds [100001 x i8], ptr @sv, i64 0, i64 %17
  store i8 1, ptr %18, align 1, !tbaa !11
  %19 = add nuw nsw i64 %.06884, 1
  %20 = mul nuw nsw i64 %19, %.06585
  %21 = icmp ult i64 %20, 100001
  br i1 %21, label %.lr.ph, label %.loopexit, !llvm.loop !15

.loopexit:                                        ; preds = %.lr.ph, %11
  %22 = add nuw nsw i64 %.06585, 1
  %exitcond.not = icmp eq i64 %22, 100001
  br i1 %exitcond.not, label %10, label %11, !llvm.loop !17

23:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #8
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @N)
  %25 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(8) @M)
  %26 = load i64, ptr @N, align 8, !tbaa !8
  %27 = icmp sgt i64 %26, 0
  br i1 %27, label %.lr.ph88, label %._crit_edge

28:                                               ; preds = %10, %33
  %storemerge86 = phi i64 [ 1, %10 ], [ %35, %33 ]
  %29 = getelementptr inbounds [100001 x i8], ptr @sv, i64 0, i64 %storemerge86
  %30 = load i8, ptr %29, align 1, !tbaa !11, !range !13, !noundef !14
  %31 = trunc nuw i8 %30 to i1
  br i1 %31, label %33, label %32

32:                                               ; preds = %28
  call void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24) @pr, ptr noundef nonnull align 8 dereferenceable(8) %1)
  %.pre = load i64, ptr %1, align 8, !tbaa !8
  br label %33

33:                                               ; preds = %28, %32
  %34 = phi i64 [ %storemerge86, %28 ], [ %.pre, %32 ]
  %35 = add nsw i64 %34, 1
  store i64 %35, ptr %1, align 8, !tbaa !8
  %36 = icmp slt i64 %34, 100000
  br i1 %36, label %28, label %23, !llvm.loop !18

._crit_edge:                                      ; preds = %.lr.ph88, %23
  call void @_Z3dfsxxx(i64 noundef 1, i64 noundef 0, i64 noundef 0)
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #8
  %37 = call ptr @_ZNSt6vectorISt4pairIxbESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) @nm) #8
  store ptr %37, ptr %2, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %3) #8
  %38 = call ptr @_ZNSt6vectorISt4pairIxbESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) @nm) #8
  store ptr %38, ptr %3, align 8
  %39 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxbESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  br i1 %39, label %.lr.ph114, label %._crit_edge115

.lr.ph88:                                         ; preds = %23, %.lr.ph88
  %.07087 = phi i64 [ %44, %.lr.ph88 ], [ 0, %23 ]
  %40 = getelementptr inbounds [50 x i64], ptr @L, i64 0, i64 %.07087
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %40)
  %42 = getelementptr inbounds [50 x i64], ptr @R, i64 0, i64 %.07087
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %41, ptr noundef nonnull align 8 dereferenceable(8) %42)
  %44 = add nuw nsw i64 %.07087, 1
  %45 = load i64, ptr @N, align 8, !tbaa !8
  %46 = icmp slt i64 %44, %45
  br i1 %46, label %.lr.ph88, label %._crit_edge, !llvm.loop !19

._crit_edge115:                                   ; preds = %._crit_edge110, %._crit_edge
  %.071.lcssa = phi i64 [ 0, %._crit_edge ], [ %116, %._crit_edge110 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %3) #8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #8
  %47 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEx(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i64 noundef %.071.lcssa)
  %48 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %47, i8 noundef signext 10)
  ret i32 0

.lr.ph114:                                        ; preds = %._crit_edge, %._crit_edge110
  %.071112 = phi i64 [ %116, %._crit_edge110 ], [ 0, %._crit_edge ]
  %49 = call noundef nonnull align 8 dereferenceable(9) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIxbESt6vectorIS2_SaIS2_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #8
  %.sroa.0.0.copyload = load i64, ptr %49, align 8
  %.sroa.4.0..sroa_idx = getelementptr inbounds i8, ptr %49, i64 8
  %.sroa.4.0.copyload = load i8, ptr %.sroa.4.0..sroa_idx, align 8
  %50 = trunc i8 %.sroa.4.0.copyload to i1
  store i64 1, ptr @dp, align 16, !tbaa !8
  %51 = load i64, ptr @N, align 8, !tbaa !8
  %52 = icmp sgt i64 %51, 0
  %.pre125 = load i64, ptr @M, align 8, !tbaa !8
  %.pre126.pre = load i64, ptr @MOD, align 8
  %53 = sdiv i64 %.pre125, %.sroa.0.0.copyload
  br i1 %52, label %.lr.ph105, label %.preheader81

.lr.ph105:                                        ; preds = %.lr.ph114
  %.not7789 = icmp slt i64 %53, 0
  %.not8098 = icmp slt i64 %53, 1
  %54 = shl i64 %53, 3
  %55 = add i64 %54, 8
  %xtraiter = and i64 %53, 1
  %56 = icmp eq i64 %53, 1
  %unroll_iter = and i64 %53, 9223372036854775806
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br label %59

.preheader81:                                     ; preds = %._crit_edge102, %.lr.ph114
  %.not106 = icmp slt i64 %53, 0
  br i1 %.not106, label %._crit_edge110, label %.lr.ph109.preheader

.lr.ph109.preheader:                              ; preds = %.preheader81
  %57 = icmp eq i64 %53, 0
  br i1 %57, label %._crit_edge110.loopexit.unr-lcssa, label %.lr.ph109.preheader.new

.lr.ph109.preheader.new:                          ; preds = %.lr.ph109.preheader
  %58 = add nuw i64 %53, 1
  %unroll_iter136 = and i64 %58, -2
  br label %.lr.ph109

59:                                               ; preds = %.lr.ph105, %._crit_edge102
  %.069103 = phi i64 [ 0, %.lr.ph105 ], [ %.pre-phi, %._crit_edge102 ]
  %60 = getelementptr inbounds [50 x i64], ptr @L, i64 0, i64 %.069103
  %61 = load i64, ptr %60, align 8, !tbaa !8
  %62 = sdiv i64 %61, %.sroa.0.0.copyload
  %63 = srem i64 %61, %.sroa.0.0.copyload
  %64 = icmp ne i64 %63, 0
  %65 = zext i1 %64 to i64
  %66 = add nsw i64 %62, %65
  %67 = getelementptr inbounds [50 x i64], ptr @R, i64 0, i64 %.069103
  %68 = load i64, ptr %67, align 8, !tbaa !8
  %69 = sdiv i64 %68, %.sroa.0.0.copyload
  br i1 %.not7789, label %._crit_edge96.._crit_edge102_crit_edge, label %.lr.ph95

.lr.ph95:                                         ; preds = %59
  %70 = mul nuw i64 %.069103, 800008
  %gep = getelementptr i8, ptr getelementptr inbounds (i8, ptr @dp, i64 800008), i64 %70
  call void @llvm.memset.p0.i64(ptr align 8 %gep, i8 0, i64 %55, i1 false), !tbaa !8
  %71 = add nuw nsw i64 %.069103, 1
  br label %72

72:                                               ; preds = %.lr.ph95, %88
  %.06694 = phi i64 [ 0, %.lr.ph95 ], [ %89, %88 ]
  %73 = add nsw i64 %66, %.06694
  %74 = icmp sgt i64 %73, %53
  br i1 %74, label %._crit_edge96, label %75

75:                                               ; preds = %72
  %76 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %.069103, i64 %.06694
  %77 = load i64, ptr %76, align 8, !tbaa !8
  %78 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %71, i64 %73
  %79 = load i64, ptr %78, align 8, !tbaa !8
  %80 = add nsw i64 %79, %77
  store i64 %80, ptr %78, align 8, !tbaa !8
  %81 = add nsw i64 %.06694, %69
  %.not79.not = icmp slt i64 %81, %53
  br i1 %.not79.not, label %82, label %88

82:                                               ; preds = %75
  %83 = add nsw i64 %81, 1
  %84 = load i64, ptr %76, align 8, !tbaa !8
  %85 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %71, i64 %83
  %86 = load i64, ptr %85, align 8, !tbaa !8
  %87 = sub nsw i64 %86, %84
  store i64 %87, ptr %85, align 8, !tbaa !8
  br label %88

88:                                               ; preds = %75, %82
  %89 = add nuw i64 %.06694, 1
  %exitcond120.not = icmp eq i64 %.06694, %53
  br i1 %exitcond120.not, label %._crit_edge96, label %72, !llvm.loop !20

._crit_edge96:                                    ; preds = %88, %72
  br i1 %.not8098, label %._crit_edge96.._crit_edge102_crit_edge, label %.lr.ph101

._crit_edge96.._crit_edge102_crit_edge:           ; preds = %59, %._crit_edge96
  %.pre127 = add nuw nsw i64 %.069103, 1
  br label %._crit_edge102

.lr.ph101:                                        ; preds = %._crit_edge96
  %90 = add nuw nsw i64 %.069103, 1
  %.phi.trans.insert = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %90, i64 0
  %.pre124 = load i64, ptr %.phi.trans.insert, align 8, !tbaa !8
  br i1 %56, label %._crit_edge102.loopexit.unr-lcssa, label %.lr.ph101.new

._crit_edge102.loopexit.unr-lcssa:                ; preds = %.lr.ph101.new, %.lr.ph101
  %.unr = phi i64 [ %.pre124, %.lr.ph101 ], [ %104, %.lr.ph101.new ]
  %.06499.unr = phi i64 [ 1, %.lr.ph101 ], [ %105, %.lr.ph101.new ]
  br i1 %lcmp.mod.not, label %._crit_edge102, label %._crit_edge102.loopexit.epilog-lcssa

._crit_edge102.loopexit.epilog-lcssa:             ; preds = %._crit_edge102.loopexit.unr-lcssa
  %91 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %90, i64 %.06499.unr
  %92 = load i64, ptr %91, align 8, !tbaa !8
  %93 = add nsw i64 %.unr, %92
  %94 = srem i64 %93, %.pre126.pre
  store i64 %94, ptr %91, align 8, !tbaa !8
  br label %._crit_edge102

._crit_edge102:                                   ; preds = %._crit_edge102.loopexit.epilog-lcssa, %._crit_edge102.loopexit.unr-lcssa, %._crit_edge96.._crit_edge102_crit_edge
  %.pre-phi = phi i64 [ %.pre127, %._crit_edge96.._crit_edge102_crit_edge ], [ %90, %._crit_edge102.loopexit.unr-lcssa ], [ %90, %._crit_edge102.loopexit.epilog-lcssa ]
  %exitcond122.not = icmp eq i64 %.pre-phi, %51
  br i1 %exitcond122.not, label %.preheader81, label %59, !llvm.loop !21

.lr.ph101.new:                                    ; preds = %.lr.ph101, %.lr.ph101.new
  %95 = phi i64 [ %104, %.lr.ph101.new ], [ %.pre124, %.lr.ph101 ]
  %.06499 = phi i64 [ %105, %.lr.ph101.new ], [ 1, %.lr.ph101 ]
  %niter = phi i64 [ %niter.next.1, %.lr.ph101.new ], [ 0, %.lr.ph101 ]
  %96 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %90, i64 %.06499
  %97 = load i64, ptr %96, align 8, !tbaa !8
  %98 = add nsw i64 %95, %97
  %99 = srem i64 %98, %.pre126.pre
  store i64 %99, ptr %96, align 8, !tbaa !8
  %100 = add nuw i64 %.06499, 1
  %101 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %90, i64 %100
  %102 = load i64, ptr %101, align 8, !tbaa !8
  %103 = add nsw i64 %99, %102
  %104 = srem i64 %103, %.pre126.pre
  store i64 %104, ptr %101, align 8, !tbaa !8
  %105 = add nuw i64 %.06499, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge102.loopexit.unr-lcssa, label %.lr.ph101.new, !llvm.loop !22

._crit_edge110.loopexit.unr-lcssa:                ; preds = %.lr.ph109, %.lr.ph109.preheader
  %.lcssa.ph = phi i64 [ poison, %.lr.ph109.preheader ], [ %127, %.lr.ph109 ]
  %.0108.unr = phi i64 [ 0, %.lr.ph109.preheader ], [ %128, %.lr.ph109 ]
  %.063107.unr = phi i64 [ 0, %.lr.ph109.preheader ], [ %127, %.lr.ph109 ]
  %106 = and i64 %53, 1
  %lcmp.mod134.not.not = icmp eq i64 %106, 0
  br i1 %lcmp.mod134.not.not, label %.lr.ph109.epil, label %._crit_edge110

.lr.ph109.epil:                                   ; preds = %._crit_edge110.loopexit.unr-lcssa
  %107 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %51, i64 %.0108.unr
  %108 = load i64, ptr %107, align 8, !tbaa !8
  %109 = add nsw i64 %108, %.063107.unr
  %110 = srem i64 %109, %.pre126.pre
  br label %._crit_edge110

._crit_edge110:                                   ; preds = %.lr.ph109.epil, %._crit_edge110.loopexit.unr-lcssa, %.preheader81
  %.063.lcssa = phi i64 [ 0, %.preheader81 ], [ %.lcssa.ph, %._crit_edge110.loopexit.unr-lcssa ], [ %110, %.lr.ph109.epil ]
  %111 = sub nsw i64 0, %.063.lcssa
  %112 = select i1 %50, i64 %111, i64 %.063.lcssa
  %113 = add nsw i64 %112, %.071112
  %114 = srem i64 %113, %.pre126.pre
  %115 = add nsw i64 %114, %.pre126.pre
  %116 = srem i64 %115, %.pre126.pre
  %117 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIxbESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %2) #8
  %118 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIxbESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %2, ptr noundef nonnull align 8 dereferenceable(8) %3) #8
  br i1 %118, label %.lr.ph114, label %._crit_edge115

.lr.ph109:                                        ; preds = %.lr.ph109, %.lr.ph109.preheader.new
  %.0108 = phi i64 [ 0, %.lr.ph109.preheader.new ], [ %128, %.lr.ph109 ]
  %.063107 = phi i64 [ 0, %.lr.ph109.preheader.new ], [ %127, %.lr.ph109 ]
  %niter137 = phi i64 [ 0, %.lr.ph109.preheader.new ], [ %niter137.next.1, %.lr.ph109 ]
  %119 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %51, i64 %.0108
  %120 = load i64, ptr %119, align 8, !tbaa !8
  %121 = add nsw i64 %120, %.063107
  %122 = srem i64 %121, %.pre126.pre
  %123 = or disjoint i64 %.0108, 1
  %124 = getelementptr inbounds [51 x [100001 x i64]], ptr @dp, i64 0, i64 %51, i64 %123
  %125 = load i64, ptr %124, align 8, !tbaa !8
  %126 = add nsw i64 %125, %122
  %127 = srem i64 %126, %.pre126.pre
  %128 = add nuw i64 %.0108, 2
  %niter137.next.1 = add i64 %niter137, 2
  %niter137.ncmp.1 = icmp eq i64 %niter137.next.1, %unroll_iter136
  br i1 %niter137.ncmp.1, label %._crit_edge110.loopexit.unr-lcssa, label %.lr.ph109, !llvm.loop !23
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIxSaIxEE9push_backERKx(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #0 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 #0 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #6

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #7

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

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

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


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