; LLVM IR from VastoLorde95/Competitive-Programming :: Hackerrank/101 Hacks/101 Hack 2017/101 Hack Jan/Problem D (D)

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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@n = external dso_local global i64, align 8
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@q = external dso_local global i64, align 8
@c = external dso_local global [100100 x i64], align 16
@F = external dso_local global i64, align 8
@B = external dso_local global i64, align 8
@block = external dso_local global [500 x i64], align 16
@pw = external dso_local global [100100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4fastxx(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 nounwind uwtable
declare dso_local void @_Z6updatexx(i64 noundef, i64 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i64, align 8
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i64, align 8
  %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
  %23 = alloca i64, align 8
  %24 = alloca i64, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i64, align 8
  %28 = alloca i64, align 8
  %29 = alloca i64, align 8
  %30 = alloca i64, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  %34 = alloca i32, align 4
  %35 = alloca i32, align 4
  %36 = alloca i32, align 4
  %37 = alloca i32, align 4
  %38 = alloca i64, align 8
  store i32 0, ptr %1, align 4
  %39 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %40 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %41 = getelementptr i8, ptr %40, i64 -24
  %42 = load i64, ptr %41, align 8
  %43 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %42
  %44 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %43, ptr noundef null)
  %45 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %46 = getelementptr i8, ptr %45, i64 -24
  %47 = load i64, ptr %46, align 8
  %48 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %47
  %49 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %48, ptr noundef null)
  %50 = 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)
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %50, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %52 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %51, ptr noundef nonnull align 8 dereferenceable(8) @b)
  %53 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %52, ptr noundef nonnull align 8 dereferenceable(8) @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  store i32 0, ptr %2, align 4, !tbaa !8
  br label %54

54:                                               ; preds = %65, %0
  %55 = load i32, ptr %2, align 4, !tbaa !8
  %56 = sext i32 %55 to i64
  %57 = load i64, ptr @n, align 8, !tbaa !11
  %58 = icmp slt i64 %56, %57
  br i1 %58, label %60, label %59

59:                                               ; preds = %54
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %68

60:                                               ; preds = %54
  %61 = load i32, ptr %2, align 4, !tbaa !8
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %62
  %64 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %63)
  br label %65

65:                                               ; preds = %60
  %66 = load i32, ptr %2, align 4, !tbaa !8
  %67 = add nsw i32 %66, 1
  store i32 %67, ptr %2, align 4, !tbaa !8
  br label %54, !llvm.loop !13

68:                                               ; preds = %59
  %69 = load i64, ptr @b, align 8, !tbaa !11
  %70 = call noundef i64 @_Z4fastxx(i64 noundef %69, i64 noundef 1000000005)
  store i64 %70, ptr @F, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %71 = load i64, ptr @a, align 8, !tbaa !11
  %72 = load i64, ptr @F, align 8, !tbaa !11
  %73 = mul nsw i64 %71, %72
  %74 = srem i64 %73, 1000000007
  store i64 %74, ptr %3, align 8, !tbaa !11
  store i64 1, ptr @pw, align 16, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  store i32 1, ptr %4, align 4, !tbaa !8
  br label %75

75:                                               ; preds = %93, %68
  %76 = load i32, ptr %4, align 4, !tbaa !8
  %77 = sext i32 %76 to i64
  %78 = load i64, ptr @n, align 8, !tbaa !11
  %79 = icmp sle i64 %77, %78
  br i1 %79, label %81, label %80

80:                                               ; preds = %75
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  br label %96

81:                                               ; preds = %75
  %82 = load i32, ptr %4, align 4, !tbaa !8
  %83 = sub nsw i32 %82, 1
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %84
  %86 = load i64, ptr %85, align 8, !tbaa !11
  %87 = load i64, ptr %3, align 8, !tbaa !11
  %88 = mul nsw i64 %86, %87
  %89 = srem i64 %88, 1000000007
  %90 = load i32, ptr %4, align 4, !tbaa !8
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %91
  store i64 %89, ptr %92, align 8, !tbaa !11
  br label %93

93:                                               ; preds = %81
  %94 = load i32, ptr %4, align 4, !tbaa !8
  %95 = add nsw i32 %94, 1
  store i32 %95, ptr %4, align 4, !tbaa !8
  br label %75, !llvm.loop !15

96:                                               ; preds = %80
  %97 = load i64, ptr @n, align 8, !tbaa !11
  %98 = call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %97)
  %99 = fptosi double %98 to i32
  %100 = add nsw i32 1, %99
  %101 = sext i32 %100 to i64
  store i64 %101, ptr @B, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  store i32 0, ptr %5, align 4, !tbaa !8
  br label %102

102:                                              ; preds = %134, %96
  %103 = load i32, ptr %5, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = load i64, ptr @n, align 8, !tbaa !11
  %106 = icmp slt i64 %104, %105
  br i1 %106, label %108, label %107

107:                                              ; preds = %102
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  br label %137

108:                                              ; preds = %102
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %109 = load i32, ptr %5, align 4, !tbaa !8
  %110 = sext i32 %109 to i64
  %111 = load i64, ptr @B, align 8, !tbaa !11
  %112 = sdiv i64 %110, %111
  %113 = trunc i64 %112 to i32
  store i32 %113, ptr %6, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  %114 = load i32, ptr %6, align 4, !tbaa !8
  %115 = add nsw i32 %114, 1
  %116 = sext i32 %115 to i64
  %117 = load i64, ptr @B, align 8, !tbaa !11
  %118 = mul nsw i64 %116, %117
  %119 = sub nsw i64 %118, 1
  %120 = trunc i64 %119 to i32
  store i32 %120, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  %121 = load i32, ptr %7, align 4, !tbaa !8
  %122 = sext i32 %121 to i64
  %123 = mul nsw i64 1, %122
  store i64 %123, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  %124 = load i64, ptr @n, align 8, !tbaa !11
  %125 = sub nsw i64 %124, 1
  store i64 %125, ptr %9, align 8, !tbaa !11
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %127 = load i64, ptr %126, align 8, !tbaa !11
  %128 = trunc i64 %127 to i32
  store i32 %128, ptr %7, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  %129 = load i32, ptr %5, align 4, !tbaa !8
  %130 = sext i32 %129 to i64
  %131 = load i32, ptr %7, align 4, !tbaa !8
  %132 = sext i32 %131 to i64
  call void @_Z6updatexx(i64 noundef %130, i64 noundef %132)
  %133 = load i32, ptr %7, align 4, !tbaa !8
  store i32 %133, ptr %5, align 4, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  br label %134

134:                                              ; preds = %108
  %135 = load i32, ptr %5, align 4, !tbaa !8
  %136 = add nsw i32 %135, 1
  store i32 %136, ptr %5, align 4, !tbaa !8
  br label %102, !llvm.loop !16

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

138:                                              ; preds = %494, %137
  %139 = load i32, ptr %10, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = load i64, ptr @q, align 8, !tbaa !11
  %142 = icmp slt i64 %140, %141
  br i1 %142, label %144, label %143

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

144:                                              ; preds = %138
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  %145 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %146 = load i32, ptr %12, align 4, !tbaa !8
  %147 = icmp eq i32 %146, 1
  br i1 %147, label %148, label %172

148:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %149 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %13)
  %150 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %149, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %151 = load i64, ptr %14, align 8, !tbaa !11
  %152 = load i64, ptr %13, align 8, !tbaa !11
  %153 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %152
  store i64 %151, ptr %153, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #7
  %154 = load i64, ptr %13, align 8, !tbaa !11
  %155 = load i64, ptr @B, align 8, !tbaa !11
  %156 = sdiv i64 %154, %155
  store i64 %156, ptr %15, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #7
  %157 = load i64, ptr %15, align 8, !tbaa !11
  %158 = load i64, ptr @B, align 8, !tbaa !11
  %159 = mul nsw i64 %157, %158
  store i64 %159, ptr %16, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  %160 = load i64, ptr %15, align 8, !tbaa !11
  %161 = add nsw i64 %160, 1
  %162 = load i64, ptr @B, align 8, !tbaa !11
  %163 = mul nsw i64 %161, %162
  %164 = sub nsw i64 %163, 1
  store i64 %164, ptr %18, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %165 = load i64, ptr @n, align 8, !tbaa !11
  %166 = sub nsw i64 %165, 1
  %167 = mul nsw i64 1, %166
  store i64 %167, ptr %19, align 8, !tbaa !11
  %168 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 8 dereferenceable(8) %19)
  %169 = load i64, ptr %168, align 8, !tbaa !11
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  store i64 %169, ptr %17, align 8, !tbaa !11
  %170 = load i64, ptr %16, align 8, !tbaa !11
  %171 = load i64, ptr %17, align 8, !tbaa !11
  call void @_Z6updatexx(i64 noundef %170, i64 noundef %171)
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %490

172:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #7
  %173 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %20)
  %174 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %173, ptr noundef nonnull align 8 dereferenceable(8) %21)
  %175 = load i64, ptr %20, align 8, !tbaa !11
  %176 = load i64, ptr %21, align 8, !tbaa !11
  %177 = icmp eq i64 %175, %176
  br i1 %177, label %178, label %197

178:                                              ; preds = %172
  %179 = load i64, ptr @a, align 8, !tbaa !11
  %180 = icmp eq i64 %179, 0
  br i1 %180, label %181, label %184

181:                                              ; preds = %178
  %182 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %183 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %182, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %196

184:                                              ; preds = %178
  %185 = load i64, ptr %20, align 8, !tbaa !11
  %186 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %185
  %187 = load i64, ptr %186, align 8, !tbaa !11
  %188 = icmp eq i64 %187, 0
  br i1 %188, label %189, label %192

189:                                              ; preds = %184
  %190 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %191 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %190, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %195

192:                                              ; preds = %184
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %194 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %193, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %195

195:                                              ; preds = %192, %189
  br label %196

196:                                              ; preds = %195, %181
  store i32 13, ptr %11, align 4
  br label %487

197:                                              ; preds = %172
  %198 = load i64, ptr %20, align 8, !tbaa !11
  %199 = load i64, ptr @B, align 8, !tbaa !11
  %200 = sdiv i64 %198, %199
  %201 = load i64, ptr %21, align 8, !tbaa !11
  %202 = sub nsw i64 %201, 1
  %203 = load i64, ptr @B, align 8, !tbaa !11
  %204 = sdiv i64 %202, %203
  %205 = icmp eq i64 %200, %204
  br i1 %205, label %206, label %282

206:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #7
  store i64 0, ptr %22, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  %207 = load i64, ptr @a, align 8, !tbaa !11
  %208 = load i64, ptr @F, align 8, !tbaa !11
  %209 = mul nsw i64 %207, %208
  %210 = srem i64 %209, 1000000007
  store i64 %210, ptr %23, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #7
  store i64 1, ptr %24, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %211 = load i64, ptr %21, align 8, !tbaa !11
  %212 = sub nsw i64 %211, 1
  %213 = trunc i64 %212 to i32
  store i32 %213, ptr %25, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !8
  br label %214

214:                                              ; preds = %255, %206
  %215 = load i32, ptr %25, align 4, !tbaa !8
  %216 = sext i32 %215 to i64
  %217 = load i64, ptr %20, align 8, !tbaa !11
  %218 = icmp sge i64 %216, %217
  br i1 %218, label %220, label %219

219:                                              ; preds = %214
  store i32 14, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  br label %260

220:                                              ; preds = %214
  %221 = load i32, ptr %26, align 4, !tbaa !8
  %222 = srem i32 %221, 2
  %223 = icmp eq i32 %222, 0
  br i1 %223, label %224, label %236

224:                                              ; preds = %220
  %225 = load i32, ptr %25, align 4, !tbaa !8
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %226
  %228 = load i64, ptr %227, align 8, !tbaa !11
  %229 = load i64, ptr %24, align 8, !tbaa !11
  %230 = mul nsw i64 %228, %229
  %231 = srem i64 %230, 1000000007
  %232 = load i64, ptr %22, align 8, !tbaa !11
  %233 = add nsw i64 %232, %231
  store i64 %233, ptr %22, align 8, !tbaa !11
  %234 = load i64, ptr %22, align 8, !tbaa !11
  %235 = srem i64 %234, 1000000007
  store i64 %235, ptr %22, align 8, !tbaa !11
  br label %250

236:                                              ; preds = %220
  %237 = load i32, ptr %25, align 4, !tbaa !8
  %238 = sext i32 %237 to i64
  %239 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %238
  %240 = load i64, ptr %239, align 8, !tbaa !11
  %241 = load i64, ptr %24, align 8, !tbaa !11
  %242 = mul nsw i64 %240, %241
  %243 = srem i64 %242, 1000000007
  %244 = load i64, ptr %22, align 8, !tbaa !11
  %245 = sub nsw i64 %244, %243
  store i64 %245, ptr %22, align 8, !tbaa !11
  %246 = load i64, ptr %22, align 8, !tbaa !11
  %247 = add nsw i64 %246, 1000000007
  store i64 %247, ptr %22, align 8, !tbaa !11
  %248 = load i64, ptr %22, align 8, !tbaa !11
  %249 = srem i64 %248, 1000000007
  store i64 %249, ptr %22, align 8, !tbaa !11
  br label %250

250:                                              ; preds = %236, %224
  %251 = load i64, ptr %24, align 8, !tbaa !11
  %252 = load i64, ptr %23, align 8, !tbaa !11
  %253 = mul nsw i64 %251, %252
  %254 = srem i64 %253, 1000000007
  store i64 %254, ptr %24, align 8, !tbaa !11
  br label %255

255:                                              ; preds = %250
  %256 = load i32, ptr %25, align 4, !tbaa !8
  %257 = add nsw i32 %256, -1
  store i32 %257, ptr %25, align 4, !tbaa !8
  %258 = load i32, ptr %26, align 4, !tbaa !8
  %259 = add nsw i32 %258, 1
  store i32 %259, ptr %26, align 4, !tbaa !8
  br label %214, !llvm.loop !17

260:                                              ; preds = %219
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #7
  %261 = load i64, ptr %21, align 8, !tbaa !11
  %262 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %261
  %263 = load i64, ptr %262, align 8, !tbaa !11
  %264 = load i64, ptr @a, align 8, !tbaa !11
  %265 = call noundef i64 @_Z4fastxx(i64 noundef %264, i64 noundef 1000000005)
  %266 = mul nsw i64 %263, %265
  %267 = srem i64 %266, 1000000007
  store i64 %267, ptr %27, align 8, !tbaa !11
  %268 = load i64, ptr %22, align 8, !tbaa !11
  %269 = load i64, ptr @F, align 8, !tbaa !11
  %270 = mul nsw i64 %268, %269
  %271 = srem i64 %270, 1000000007
  store i64 %271, ptr %22, align 8, !tbaa !11
  %272 = load i64, ptr %22, align 8, !tbaa !11
  %273 = load i64, ptr %27, align 8, !tbaa !11
  %274 = icmp eq i64 %272, %273
  br i1 %274, label %275, label %278

275:                                              ; preds = %260
  %276 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %277 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %276, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %281

278:                                              ; preds = %260
  %279 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %280 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %279, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %281

281:                                              ; preds = %278, %275
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #7
  br label %486

282:                                              ; preds = %197
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #7
  store i64 0, ptr %28, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %283 = load i64, ptr @a, align 8, !tbaa !11
  %284 = load i64, ptr @F, align 8, !tbaa !11
  %285 = mul nsw i64 %283, %284
  %286 = srem i64 %285, 1000000007
  store i64 %286, ptr %29, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %30) #7
  store i64 1, ptr %30, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #7
  %287 = load i64, ptr %21, align 8, !tbaa !11
  %288 = sub nsw i64 %287, 1
  %289 = load i64, ptr @B, align 8, !tbaa !11
  %290 = sdiv i64 %288, %289
  %291 = load i64, ptr @B, align 8, !tbaa !11
  %292 = mul nsw i64 %290, %291
  %293 = trunc i64 %292 to i32
  store i32 %293, ptr %31, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #7
  store i32 0, ptr %32, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #7
  %294 = load i64, ptr %21, align 8, !tbaa !11
  %295 = sub nsw i64 %294, 1
  %296 = trunc i64 %295 to i32
  store i32 %296, ptr %33, align 4, !tbaa !8
  br label %297

297:                                              ; preds = %337, %282
  %298 = load i32, ptr %33, align 4, !tbaa !8
  %299 = load i32, ptr %31, align 4, !tbaa !8
  %300 = icmp sge i32 %298, %299
  br i1 %300, label %302, label %301

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

302:                                              ; preds = %297
  %303 = load i32, ptr %32, align 4, !tbaa !8
  %304 = srem i32 %303, 2
  %305 = icmp eq i32 %304, 0
  br i1 %305, label %306, label %318

306:                                              ; preds = %302
  %307 = load i32, ptr %33, align 4, !tbaa !8
  %308 = sext i32 %307 to i64
  %309 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %308
  %310 = load i64, ptr %309, align 8, !tbaa !11
  %311 = load i64, ptr %30, align 8, !tbaa !11
  %312 = mul nsw i64 %310, %311
  %313 = srem i64 %312, 1000000007
  %314 = load i64, ptr %28, align 8, !tbaa !11
  %315 = add nsw i64 %314, %313
  store i64 %315, ptr %28, align 8, !tbaa !11
  %316 = load i64, ptr %28, align 8, !tbaa !11
  %317 = srem i64 %316, 1000000007
  store i64 %317, ptr %28, align 8, !tbaa !11
  br label %332

318:                                              ; preds = %302
  %319 = load i32, ptr %33, align 4, !tbaa !8
  %320 = sext i32 %319 to i64
  %321 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %320
  %322 = load i64, ptr %321, align 8, !tbaa !11
  %323 = load i64, ptr %30, align 8, !tbaa !11
  %324 = mul nsw i64 %322, %323
  %325 = srem i64 %324, 1000000007
  %326 = load i64, ptr %28, align 8, !tbaa !11
  %327 = sub nsw i64 %326, %325
  store i64 %327, ptr %28, align 8, !tbaa !11
  %328 = load i64, ptr %28, align 8, !tbaa !11
  %329 = add nsw i64 %328, 1000000007
  store i64 %329, ptr %28, align 8, !tbaa !11
  %330 = load i64, ptr %28, align 8, !tbaa !11
  %331 = srem i64 %330, 1000000007
  store i64 %331, ptr %28, align 8, !tbaa !11
  br label %332

332:                                              ; preds = %318, %306
  %333 = load i64, ptr %30, align 8, !tbaa !11
  %334 = load i64, ptr %29, align 8, !tbaa !11
  %335 = mul nsw i64 %333, %334
  %336 = srem i64 %335, 1000000007
  store i64 %336, ptr %30, align 8, !tbaa !11
  br label %337

337:                                              ; preds = %332
  %338 = load i32, ptr %33, align 4, !tbaa !8
  %339 = add nsw i32 %338, -1
  store i32 %339, ptr %33, align 4, !tbaa !8
  %340 = load i32, ptr %32, align 4, !tbaa !8
  %341 = add nsw i32 %340, 1
  store i32 %341, ptr %32, align 4, !tbaa !8
  br label %297, !llvm.loop !18

342:                                              ; preds = %301
  call void @llvm.lifetime.start.p0(i64 4, ptr %34) #7
  %343 = load i64, ptr %21, align 8, !tbaa !11
  %344 = sub nsw i64 %343, 1
  %345 = load i64, ptr @B, align 8, !tbaa !11
  %346 = sdiv i64 %344, %345
  %347 = trunc i64 %346 to i32
  store i32 %347, ptr %34, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %35) #7
  %348 = load i64, ptr %20, align 8, !tbaa !11
  %349 = load i64, ptr @B, align 8, !tbaa !11
  %350 = sdiv i64 %348, %349
  %351 = trunc i64 %350 to i32
  store i32 %351, ptr %35, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %36) #7
  %352 = load i32, ptr %34, align 4, !tbaa !8
  %353 = sub nsw i32 %352, 1
  store i32 %353, ptr %36, align 4, !tbaa !8
  br label %354

354:                                              ; preds = %403, %342
  %355 = load i32, ptr %36, align 4, !tbaa !8
  %356 = load i32, ptr %35, align 4, !tbaa !8
  %357 = icmp sgt i32 %355, %356
  br i1 %357, label %359, label %358

358:                                              ; preds = %354
  store i32 20, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %36) #7
  br label %406

359:                                              ; preds = %354
  %360 = load i32, ptr %32, align 4, !tbaa !8
  %361 = srem i32 %360, 2
  %362 = icmp eq i32 %361, 0
  br i1 %362, label %363, label %377

363:                                              ; preds = %359
  %364 = load i32, ptr %36, align 4, !tbaa !8
  %365 = sext i32 %364 to i64
  %366 = getelementptr inbounds [500 x i64], ptr @block, i64 0, i64 %365
  %367 = load i64, ptr %366, align 8, !tbaa !11
  %368 = load i32, ptr %32, align 4, !tbaa !8
  %369 = sub nsw i32 %368, 1
  %370 = sext i32 %369 to i64
  %371 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %370
  %372 = load i64, ptr %371, align 8, !tbaa !11
  %373 = mul nsw i64 %367, %372
  %374 = srem i64 %373, 1000000007
  %375 = load i64, ptr %28, align 8, !tbaa !11
  %376 = add nsw i64 %375, %374
  store i64 %376, ptr %28, align 8, !tbaa !11
  br label %397

377:                                              ; preds = %359
  %378 = load i32, ptr %36, align 4, !tbaa !8
  %379 = sext i32 %378 to i64
  %380 = getelementptr inbounds [500 x i64], ptr @block, i64 0, i64 %379
  %381 = load i64, ptr %380, align 8, !tbaa !11
  %382 = load i32, ptr %32, align 4, !tbaa !8
  %383 = sub nsw i32 %382, 1
  %384 = sext i32 %383 to i64
  %385 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %384
  %386 = load i64, ptr %385, align 8, !tbaa !11
  %387 = mul nsw i64 %381, %386
  %388 = srem i64 %387, 1000000007
  %389 = load i64, ptr %28, align 8, !tbaa !11
  %390 = sub nsw i64 %389, %388
  store i64 %390, ptr %28, align 8, !tbaa !11
  %391 = load i64, ptr %28, align 8, !tbaa !11
  %392 = icmp slt i64 %391, 0
  br i1 %392, label %393, label %396

393:                                              ; preds = %377
  %394 = load i64, ptr %28, align 8, !tbaa !11
  %395 = add nsw i64 %394, 1000000007
  store i64 %395, ptr %28, align 8, !tbaa !11
  br label %396

396:                                              ; preds = %393, %377
  br label %397

397:                                              ; preds = %396, %363
  %398 = load i64, ptr @B, align 8, !tbaa !11
  %399 = load i32, ptr %32, align 4, !tbaa !8
  %400 = sext i32 %399 to i64
  %401 = add nsw i64 %400, %398
  %402 = trunc i64 %401 to i32
  store i32 %402, ptr %32, align 4, !tbaa !8
  br label %403

403:                                              ; preds = %397
  %404 = load i32, ptr %36, align 4, !tbaa !8
  %405 = add nsw i32 %404, -1
  store i32 %405, ptr %36, align 4, !tbaa !8
  br label %354, !llvm.loop !19

406:                                              ; preds = %358
  %407 = load i32, ptr %32, align 4, !tbaa !8
  %408 = sext i32 %407 to i64
  %409 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %408
  %410 = load i64, ptr %409, align 8, !tbaa !11
  store i64 %410, ptr %30, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 4, ptr %37) #7
  %411 = load i32, ptr %35, align 4, !tbaa !8
  %412 = add nsw i32 %411, 1
  %413 = sext i32 %412 to i64
  %414 = load i64, ptr @B, align 8, !tbaa !11
  %415 = mul nsw i64 %413, %414
  %416 = sub nsw i64 %415, 1
  %417 = trunc i64 %416 to i32
  store i32 %417, ptr %37, align 4, !tbaa !8
  br label %418

418:                                              ; preds = %459, %406
  %419 = load i32, ptr %37, align 4, !tbaa !8
  %420 = sext i32 %419 to i64
  %421 = load i64, ptr %20, align 8, !tbaa !11
  %422 = icmp sge i64 %420, %421
  br i1 %422, label %424, label %423

423:                                              ; preds = %418
  store i32 23, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %37) #7
  br label %464

424:                                              ; preds = %418
  %425 = load i32, ptr %32, align 4, !tbaa !8
  %426 = srem i32 %425, 2
  %427 = icmp eq i32 %426, 0
  br i1 %427, label %428, label %440

428:                                              ; preds = %424
  %429 = load i32, ptr %37, align 4, !tbaa !8
  %430 = sext i32 %429 to i64
  %431 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %430
  %432 = load i64, ptr %431, align 8, !tbaa !11
  %433 = load i64, ptr %30, align 8, !tbaa !11
  %434 = mul nsw i64 %432, %433
  %435 = srem i64 %434, 1000000007
  %436 = load i64, ptr %28, align 8, !tbaa !11
  %437 = add nsw i64 %436, %435
  store i64 %437, ptr %28, align 8, !tbaa !11
  %438 = load i64, ptr %28, align 8, !tbaa !11
  %439 = srem i64 %438, 1000000007
  store i64 %439, ptr %28, align 8, !tbaa !11
  br label %454

440:                                              ; preds = %424
  %441 = load i32, ptr %37, align 4, !tbaa !8
  %442 = sext i32 %441 to i64
  %443 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %442
  %444 = load i64, ptr %443, align 8, !tbaa !11
  %445 = load i64, ptr %30, align 8, !tbaa !11
  %446 = mul nsw i64 %444, %445
  %447 = srem i64 %446, 1000000007
  %448 = load i64, ptr %28, align 8, !tbaa !11
  %449 = sub nsw i64 %448, %447
  store i64 %449, ptr %28, align 8, !tbaa !11
  %450 = load i64, ptr %28, align 8, !tbaa !11
  %451 = add nsw i64 %450, 1000000007
  store i64 %451, ptr %28, align 8, !tbaa !11
  %452 = load i64, ptr %28, align 8, !tbaa !11
  %453 = srem i64 %452, 1000000007
  store i64 %453, ptr %28, align 8, !tbaa !11
  br label %454

454:                                              ; preds = %440, %428
  %455 = load i64, ptr %30, align 8, !tbaa !11
  %456 = load i64, ptr %29, align 8, !tbaa !11
  %457 = mul nsw i64 %455, %456
  %458 = srem i64 %457, 1000000007
  store i64 %458, ptr %30, align 8, !tbaa !11
  br label %459

459:                                              ; preds = %454
  %460 = load i32, ptr %37, align 4, !tbaa !8
  %461 = add nsw i32 %460, -1
  store i32 %461, ptr %37, align 4, !tbaa !8
  %462 = load i32, ptr %32, align 4, !tbaa !8
  %463 = add nsw i32 %462, 1
  store i32 %463, ptr %32, align 4, !tbaa !8
  br label %418, !llvm.loop !20

464:                                              ; preds = %423
  call void @llvm.lifetime.start.p0(i64 8, ptr %38) #7
  %465 = load i64, ptr %21, align 8, !tbaa !11
  %466 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %465
  %467 = load i64, ptr %466, align 8, !tbaa !11
  %468 = load i64, ptr @a, align 8, !tbaa !11
  %469 = call noundef i64 @_Z4fastxx(i64 noundef %468, i64 noundef 1000000005)
  %470 = mul nsw i64 %467, %469
  %471 = srem i64 %470, 1000000007
  store i64 %471, ptr %38, align 8, !tbaa !11
  %472 = load i64, ptr %28, align 8, !tbaa !11
  %473 = load i64, ptr @F, align 8, !tbaa !11
  %474 = mul nsw i64 %472, %473
  %475 = srem i64 %474, 1000000007
  store i64 %475, ptr %28, align 8, !tbaa !11
  %476 = load i64, ptr %28, align 8, !tbaa !11
  %477 = load i64, ptr %38, align 8, !tbaa !11
  %478 = icmp eq i64 %476, %477
  br i1 %478, label %479, label %482

479:                                              ; preds = %464
  %480 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str)
  %481 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %480, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %485

482:                                              ; preds = %464
  %483 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef @.str.1)
  %484 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %483, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  br label %485

485:                                              ; preds = %482, %479
  call void @llvm.lifetime.end.p0(i64 8, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %35) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %34) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %30) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #7
  br label %486

486:                                              ; preds = %485, %281
  store i32 0, ptr %11, align 4
  br label %487

487:                                              ; preds = %486, %196
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  %488 = load i32, ptr %11, align 4
  switch i32 %488, label %491 [
    i32 0, label %489
  ]

489:                                              ; preds = %487
  br label %490

490:                                              ; preds = %489, %148
  store i32 0, ptr %11, align 4
  br label %491

491:                                              ; preds = %490, %487
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  %492 = load i32, ptr %11, align 4
  switch i32 %492, label %499 [
    i32 0, label %493
    i32 13, label %494
  ]

493:                                              ; preds = %491
  br label %494

494:                                              ; preds = %493, %491
  %495 = load i32, ptr %10, align 4, !tbaa !8
  %496 = add nsw i32 %495, 1
  store i32 %496, ptr %10, align 4, !tbaa !8
  br label %138, !llvm.loop !21

497:                                              ; preds = %143
  store i32 0, ptr %1, align 4
  store i32 1, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  %498 = load i32, ptr %1, align 4
  ret i32 %498

499:                                              ; preds = %491
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) #5

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

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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #6

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

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

attributes #0 = { 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 #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 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 = { 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 = { 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 = !{!12, !12, i64 0}
!12 = !{!"long long", !10, i64 0}
!13 = distinct !{!13, !14}
!14 = !{!"llvm.loop.mustprogress"}
!15 = distinct !{!15, !14}
!16 = distinct !{!16, !14}
!17 = distinct !{!17, !14}
!18 = distinct !{!18, !14}
!19 = distinct !{!19, !14}
!20 = distinct !{!20, !14}
!21 = distinct !{!21, !14}


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

%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@n = external dso_local global i64, align 8
@a = external dso_local global i64, align 8
@b = external dso_local global i64, align 8
@q = external dso_local global i64, align 8
@c = external dso_local global [100100 x i64], align 16
@F = external dso_local local_unnamed_addr global i64, align 8
@B = external dso_local local_unnamed_addr global i64, align 8
@block = external dso_local local_unnamed_addr global [500 x i64], align 16
@pw = external dso_local local_unnamed_addr global [100100 x i64], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@.str = external hidden unnamed_addr constant [4 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z4fastxx(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 nounwind uwtable
declare dso_local void @_Z6updatexx(i64 noundef, i64 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i64, align 8
  %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 i64, align 8
  %9 = alloca i64, align 8
  %10 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %11 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %12 = getelementptr i8, ptr %11, i64 -24
  %13 = load i64, ptr %12, align 8
  %14 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %13
  %15 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %14, ptr noundef null)
  %16 = load ptr, ptr @_ZSt4cout, align 8, !tbaa !5
  %17 = getelementptr i8, ptr %16, i64 -24
  %18 = load i64, ptr %17, align 8
  %19 = getelementptr inbounds i8, ptr @_ZSt4cout, i64 %18
  %20 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %19, ptr noundef null)
  %21 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) @n)
  %22 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(8) @a)
  %23 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %22, ptr noundef nonnull align 8 dereferenceable(8) @b)
  %24 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %23, ptr noundef nonnull align 8 dereferenceable(8) @q)
  %25 = load i64, ptr @n, align 8, !tbaa !8
  %26 = icmp sgt i64 %25, 0
  br i1 %26, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %0
  %27 = load i64, ptr @b, align 8, !tbaa !8
  %28 = tail call noundef i64 @_Z4fastxx(i64 noundef %27, i64 noundef 1000000005)
  store i64 %28, ptr @F, align 8, !tbaa !8
  %29 = load i64, ptr @a, align 8, !tbaa !8
  %30 = mul nsw i64 %29, %28
  %31 = srem i64 %30, 1000000007
  store i64 1, ptr @pw, align 16, !tbaa !8
  %32 = load i64, ptr @n, align 8, !tbaa !8
  %.not134 = icmp slt i64 %32, 1
  br i1 %.not134, label %._crit_edge138, label %.lr.ph137.preheader

.lr.ph137.preheader:                              ; preds = %._crit_edge
  %xtraiter = and i64 %32, 1
  %33 = icmp eq i64 %32, 1
  br i1 %33, label %._crit_edge138.loopexit.unr-lcssa, label %.lr.ph137.preheader.new

.lr.ph137.preheader.new:                          ; preds = %.lr.ph137.preheader
  %unroll_iter = and i64 %32, 9223372036854775806
  br label %.lr.ph137

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %34 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %indvars.iv
  %35 = tail call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %34)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %36 = load i64, ptr @n, align 8, !tbaa !8
  %37 = icmp sgt i64 %36, %indvars.iv.next
  br i1 %37, label %.lr.ph, label %._crit_edge, !llvm.loop !11

._crit_edge138.loopexit.unr-lcssa:                ; preds = %.lr.ph137, %.lr.ph137.preheader
  %.unr = phi i64 [ 1, %.lr.ph137.preheader ], [ %52, %.lr.ph137 ]
  %indvars.iv185.unr = phi i64 [ 1, %.lr.ph137.preheader ], [ %indvars.iv.next186.1, %.lr.ph137 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge138, label %.lr.ph137.epil

.lr.ph137.epil:                                   ; preds = %._crit_edge138.loopexit.unr-lcssa
  %38 = mul nsw i64 %.unr, %31
  %39 = srem i64 %38, 1000000007
  %40 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %indvars.iv185.unr
  store i64 %39, ptr %40, align 8, !tbaa !8
  br label %._crit_edge138

._crit_edge138:                                   ; preds = %.lr.ph137.epil, %._crit_edge138.loopexit.unr-lcssa, %._crit_edge
  %41 = tail call noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef %32)
  %42 = fptosi double %41 to i32
  %43 = add nsw i32 %42, 1
  %44 = sext i32 %43 to i64
  store i64 %44, ptr @B, align 8, !tbaa !8
  %45 = load i64, ptr @n, align 8, !tbaa !8
  %46 = icmp sgt i64 %45, 0
  br i1 %46, label %.lr.ph140, label %.preheader

.lr.ph137:                                        ; preds = %.lr.ph137, %.lr.ph137.preheader.new
  %47 = phi i64 [ 1, %.lr.ph137.preheader.new ], [ %52, %.lr.ph137 ]
  %indvars.iv185 = phi i64 [ 1, %.lr.ph137.preheader.new ], [ %indvars.iv.next186.1, %.lr.ph137 ]
  %niter = phi i64 [ 0, %.lr.ph137.preheader.new ], [ %niter.next.1, %.lr.ph137 ]
  %48 = mul nsw i64 %47, %31
  %49 = srem i64 %48, 1000000007
  %50 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %indvars.iv185
  store i64 %49, ptr %50, align 8, !tbaa !8
  %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1
  %51 = mul nsw i64 %49, %31
  %52 = srem i64 %51, 1000000007
  %53 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %indvars.iv.next186
  store i64 %52, ptr %53, align 8, !tbaa !8
  %indvars.iv.next186.1 = add nuw nsw i64 %indvars.iv185, 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_edge138.loopexit.unr-lcssa, label %.lr.ph137, !llvm.loop !13

.preheader:                                       ; preds = %.lr.ph140, %._crit_edge138
  %54 = load i64, ptr @q, align 8, !tbaa !8
  %55 = icmp sgt i64 %54, 0
  br i1 %55, label %.lr.ph180, label %._crit_edge181

.lr.ph140:                                        ; preds = %._crit_edge138, %.lr.ph140
  %56 = phi i64 [ %69, %.lr.ph140 ], [ %45, %._crit_edge138 ]
  %57 = phi i64 [ %68, %.lr.ph140 ], [ 0, %._crit_edge138 ]
  %58 = load i64, ptr @B, align 8, !tbaa !8
  %59 = sdiv i64 %57, %58
  %60 = add nsw i64 %59, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #7
  %61 = shl i64 %58, 32
  %62 = mul i64 %61, %60
  %sext129 = add i64 %62, -4294967296
  %63 = ashr exact i64 %sext129, 32
  store i64 %63, ptr %1, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #7
  %64 = add nsw i64 %56, -1
  store i64 %64, ptr %2, align 8, !tbaa !8
  %65 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull align 8 dereferenceable(8) %2)
  %66 = load i64, ptr %65, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #7
  %sext130 = shl i64 %66, 32
  %67 = ashr exact i64 %sext130, 32
  call void @_Z6updatexx(i64 noundef %57, i64 noundef %67)
  %sext = add i64 %sext130, 4294967296
  %68 = ashr exact i64 %sext, 32
  %69 = load i64, ptr @n, align 8, !tbaa !8
  %70 = icmp slt i64 %68, %69
  br i1 %70, label %.lr.ph140, label %.preheader, !llvm.loop !14

._crit_edge181:                                   ; preds = %213, %.preheader
  ret i32 0

.lr.ph180:                                        ; preds = %.preheader, %213
  %indvars.iv198 = phi i64 [ %indvars.iv.next199, %213 ], [ 0, %.preheader ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %72 = load i32, ptr %3, align 4, !tbaa !15
  %73 = icmp eq i32 %72, 1
  br i1 %73, label %74, label %90

74:                                               ; preds = %.lr.ph180
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %75 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %4)
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %75, ptr noundef nonnull align 8 dereferenceable(8) %5)
  %77 = load i64, ptr %5, align 8, !tbaa !8
  %78 = load i64, ptr %4, align 8, !tbaa !8
  %79 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %78
  store i64 %77, ptr %79, align 8, !tbaa !8
  %80 = load i64, ptr @B, align 8, !tbaa !8
  %81 = sdiv i64 %78, %80
  %82 = mul nsw i64 %81, %80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %83 = add nsw i64 %81, 1
  %84 = mul nsw i64 %83, %80
  %85 = add nsw i64 %84, -1
  store i64 %85, ptr %6, align 8, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %86 = load i64, ptr @n, align 8, !tbaa !8
  %87 = add nsw i64 %86, -1
  store i64 %87, ptr %7, align 8, !tbaa !8
  %88 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3minIxERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  %89 = load i64, ptr %88, align 8, !tbaa !8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @_Z6updatexx(i64 noundef %82, i64 noundef %89)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #7
  br label %213

90:                                               ; preds = %.lr.ph180
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %91 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %92 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERx(ptr noundef nonnull align 8 dereferenceable(16) %91, ptr noundef nonnull align 8 dereferenceable(8) %9)
  %93 = load i64, ptr %8, align 8, !tbaa !8
  %94 = load i64, ptr %9, align 8, !tbaa !8
  %.not127 = icmp eq i64 %93, %94
  br i1 %.not127, label %95, label %102

95:                                               ; preds = %90
  %96 = load i64, ptr @a, align 8, !tbaa !8
  %97 = icmp eq i64 %96, 0
  br i1 %97, label %210, label %98

98:                                               ; preds = %95
  %99 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %93
  %100 = load i64, ptr %99, align 8, !tbaa !8
  %101 = icmp eq i64 %100, 0
  %.str..str.1 = select i1 %101, ptr @.str, ptr @.str.1
  br label %210

102:                                              ; preds = %90
  %103 = load i64, ptr @B, align 8, !tbaa !8
  %104 = sdiv i64 %93, %103
  %105 = add nsw i64 %94, -1
  %106 = sdiv i64 %105, %103
  %107 = icmp eq i64 %104, %106
  %108 = load i64, ptr @a, align 8, !tbaa !8
  %109 = load i64, ptr @F, align 8, !tbaa !8
  %110 = mul nsw i64 %109, %108
  %111 = srem i64 %110, 1000000007
  br i1 %107, label %112, label %135

112:                                              ; preds = %102
  %sext182 = shl i64 %105, 32
  %113 = ashr exact i64 %sext182, 32
  %.not126170 = icmp sgt i64 %93, %113
  br i1 %.not126170, label %._crit_edge177, label %.lr.ph176

._crit_edge177:                                   ; preds = %.lr.ph176, %112
  %.0108.lcssa = phi i64 [ 0, %112 ], [ %.1109, %.lr.ph176 ]
  %114 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %94
  %115 = load i64, ptr %114, align 8, !tbaa !8
  %116 = call noundef i64 @_Z4fastxx(i64 noundef %108, i64 noundef 1000000005)
  %117 = mul nsw i64 %116, %115
  %118 = srem i64 %117, 1000000007
  %119 = load i64, ptr @F, align 8, !tbaa !8
  %120 = mul nsw i64 %119, %.0108.lcssa
  %121 = srem i64 %120, 1000000007
  %122 = icmp eq i64 %121, %118
  %.str..str.1203 = select i1 %122, ptr @.str, ptr @.str.1
  br label %210

.lr.ph176:                                        ; preds = %112, %.lr.ph176
  %indvars.iv195 = phi i64 [ %indvars.iv.next196, %.lr.ph176 ], [ %113, %112 ]
  %.0105174 = phi i32 [ %134, %.lr.ph176 ], [ 0, %112 ]
  %.0107172 = phi i64 [ %133, %.lr.ph176 ], [ 1, %112 ]
  %.0108171 = phi i64 [ %.1109, %.lr.ph176 ], [ 0, %112 ]
  %123 = and i32 %.0105174, 1
  %124 = icmp eq i32 %123, 0
  %125 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %indvars.iv195
  %126 = load i64, ptr %125, align 8, !tbaa !8
  %127 = mul nsw i64 %126, %.0107172
  %128 = srem i64 %127, 1000000007
  %129 = add nsw i64 %128, %.0108171
  %130 = add nsw i64 %.0108171, 1000000007
  %131 = sub nsw i64 %130, %128
  %.1109.in = select i1 %124, i64 %129, i64 %131
  %.1109 = srem i64 %.1109.in, 1000000007
  %132 = mul nsw i64 %.0107172, %111
  %133 = srem i64 %132, 1000000007
  %indvars.iv.next196 = add nsw i64 %indvars.iv195, -1
  %134 = add nuw nsw i32 %.0105174, 1
  %.not126.not = icmp slt i64 %93, %indvars.iv195
  br i1 %.not126.not, label %.lr.ph176, label %._crit_edge177, !llvm.loop !17

135:                                              ; preds = %102
  %136 = mul nsw i64 %106, %103
  %137 = trunc i64 %136 to i32
  %138 = trunc i64 %105 to i32
  %.not123141 = icmp slt i32 %138, %137
  br i1 %.not123141, label %._crit_edge148, label %.lr.ph147.preheader

.lr.ph147.preheader:                              ; preds = %135
  %sext201 = shl i64 %105, 32
  %139 = ashr exact i64 %sext201, 32
  %140 = trunc i64 %94 to i32
  %141 = sub i32 %140, %137
  br label %.lr.ph147

._crit_edge148:                                   ; preds = %.lr.ph147, %135
  %.0101.lcssa = phi i64 [ 0, %135 ], [ %.1102, %.lr.ph147 ]
  %.096.lcssa = phi i32 [ 0, %135 ], [ %141, %.lr.ph147 ]
  %142 = trunc i64 %106 to i32
  %143 = trunc i64 %104 to i32
  %.092151 = add nsw i32 %142, -1
  %144 = icmp sgt i32 %.092151, %143
  br i1 %144, label %.lr.ph156, label %._crit_edge157

.lr.ph156:                                        ; preds = %._crit_edge148
  %145 = trunc i64 %103 to i32
  %146 = sext i32 %.092151 to i64
  %sext202 = shl i64 %104, 32
  %147 = ashr exact i64 %sext202, 32
  br label %167

.lr.ph147:                                        ; preds = %.lr.ph147.preheader, %.lr.ph147
  %indvars.iv188 = phi i64 [ %139, %.lr.ph147.preheader ], [ %indvars.iv.next189, %.lr.ph147 ]
  %.096144 = phi i32 [ 0, %.lr.ph147.preheader ], [ %159, %.lr.ph147 ]
  %.098143 = phi i64 [ 1, %.lr.ph147.preheader ], [ %158, %.lr.ph147 ]
  %.0101142 = phi i64 [ 0, %.lr.ph147.preheader ], [ %.1102, %.lr.ph147 ]
  %148 = and i32 %.096144, 1
  %149 = icmp eq i32 %148, 0
  %150 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %indvars.iv188
  %151 = load i64, ptr %150, align 8, !tbaa !8
  %152 = mul nsw i64 %151, %.098143
  %153 = srem i64 %152, 1000000007
  %154 = add nsw i64 %153, %.0101142
  %155 = add nsw i64 %.0101142, 1000000007
  %156 = sub nsw i64 %155, %153
  %.1102.in = select i1 %149, i64 %154, i64 %156
  %.1102 = srem i64 %.1102.in, 1000000007
  %157 = mul nsw i64 %.098143, %111
  %158 = srem i64 %157, 1000000007
  %indvars.iv.next189 = add nsw i64 %indvars.iv188, -1
  %159 = add nuw i32 %.096144, 1
  %exitcond191.not = icmp eq i32 %159, %141
  br i1 %exitcond191.not, label %._crit_edge148, label %.lr.ph147, !llvm.loop !18

._crit_edge157:                                   ; preds = %184, %._crit_edge148
  %.2103.lcssa = phi i64 [ %.0101.lcssa, %._crit_edge148 ], [ %.3, %184 ]
  %.1.lcssa = phi i32 [ %.096.lcssa, %._crit_edge148 ], [ %185, %184 ]
  %160 = add i64 %104, 1
  %161 = mul i64 %160, %103
  %162 = trunc i64 %161 to i32
  %.0160 = add i32 %162, -1
  %163 = sext i32 %.0160 to i64
  %.not125161 = icmp sgt i64 %93, %163
  br i1 %.not125161, label %._crit_edge168, label %.lr.ph167.preheader

.lr.ph167.preheader:                              ; preds = %._crit_edge157
  %164 = sext i32 %.1.lcssa to i64
  %165 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %164
  %166 = load i64, ptr %165, align 8, !tbaa !8
  br label %.lr.ph167

167:                                              ; preds = %.lr.ph156, %184
  %indvars.iv192 = phi i64 [ %146, %.lr.ph156 ], [ %indvars.iv.next193, %184 ]
  %.1153 = phi i32 [ %.096.lcssa, %.lr.ph156 ], [ %185, %184 ]
  %.2103152 = phi i64 [ %.0101.lcssa, %.lr.ph156 ], [ %.3, %184 ]
  %168 = and i32 %.1153, 1
  %169 = icmp eq i32 %168, 0
  %170 = getelementptr inbounds [500 x i64], ptr @block, i64 0, i64 %indvars.iv192
  %171 = load i64, ptr %170, align 8, !tbaa !8
  %172 = add nsw i32 %.1153, -1
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [100100 x i64], ptr @pw, i64 0, i64 %173
  %175 = load i64, ptr %174, align 8, !tbaa !8
  %176 = mul nsw i64 %175, %171
  %177 = srem i64 %176, 1000000007
  br i1 %169, label %178, label %180

178:                                              ; preds = %167
  %179 = add nsw i64 %177, %.2103152
  br label %184

180:                                              ; preds = %167
  %181 = sub nsw i64 %.2103152, %177
  %182 = icmp slt i64 %181, 0
  %183 = add nsw i64 %181, 1000000007
  %spec.select = select i1 %182, i64 %183, i64 %181
  br label %184

184:                                              ; preds = %180, %178
  %.3 = phi i64 [ %179, %178 ], [ %spec.select, %180 ]
  %185 = add i32 %.1153, %145
  %indvars.iv.next193 = add nsw i64 %indvars.iv192, -1
  %186 = icmp sgt i64 %indvars.iv.next193, %147
  br i1 %186, label %167, label %._crit_edge157, !llvm.loop !19

._crit_edge168:                                   ; preds = %.lr.ph167, %._crit_edge157
  %.4.lcssa = phi i64 [ %.2103.lcssa, %._crit_edge157 ], [ %.5, %.lr.ph167 ]
  %187 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %94
  %188 = load i64, ptr %187, align 8, !tbaa !8
  %189 = call noundef i64 @_Z4fastxx(i64 noundef %108, i64 noundef 1000000005)
  %190 = mul nsw i64 %189, %188
  %191 = srem i64 %190, 1000000007
  %192 = load i64, ptr @F, align 8, !tbaa !8
  %193 = mul nsw i64 %192, %.4.lcssa
  %194 = srem i64 %193, 1000000007
  %195 = icmp eq i64 %194, %191
  %.str..str.1204 = select i1 %195, ptr @.str, ptr @.str.1
  br label %210

.lr.ph167:                                        ; preds = %.lr.ph167.preheader, %.lr.ph167
  %196 = phi i64 [ %209, %.lr.ph167 ], [ %163, %.lr.ph167.preheader ]
  %.0165 = phi i32 [ %.0, %.lr.ph167 ], [ %.0160, %.lr.ph167.preheader ]
  %.2164 = phi i32 [ %208, %.lr.ph167 ], [ %.1.lcssa, %.lr.ph167.preheader ]
  %.199163 = phi i64 [ %207, %.lr.ph167 ], [ %166, %.lr.ph167.preheader ]
  %.4162 = phi i64 [ %.5, %.lr.ph167 ], [ %.2103.lcssa, %.lr.ph167.preheader ]
  %197 = and i32 %.2164, 1
  %198 = icmp eq i32 %197, 0
  %199 = getelementptr inbounds [100100 x i64], ptr @c, i64 0, i64 %196
  %200 = load i64, ptr %199, align 8, !tbaa !8
  %201 = mul nsw i64 %200, %.199163
  %202 = srem i64 %201, 1000000007
  %203 = add nsw i64 %202, %.4162
  %204 = add i64 %.4162, 1000000007
  %205 = sub i64 %204, %202
  %.5.in = select i1 %198, i64 %203, i64 %205
  %.5 = srem i64 %.5.in, 1000000007
  %206 = mul nsw i64 %.199163, %111
  %207 = srem i64 %206, 1000000007
  %208 = add nsw i32 %.2164, 1
  %.0 = add i32 %.0165, -1
  %209 = sext i32 %.0 to i64
  %.not125 = icmp sgt i64 %93, %209
  br i1 %.not125, label %._crit_edge168, label %.lr.ph167, !llvm.loop !20

210:                                              ; preds = %._crit_edge168, %._crit_edge177, %98, %95
  %.str.1.sink = phi ptr [ @.str, %95 ], [ %.str..str.1, %98 ], [ %.str..str.1203, %._crit_edge177 ], [ %.str..str.1204, %._crit_edge168 ]
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, ptr noundef nonnull %.str.1.sink)
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %211, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br label %213

213:                                              ; preds = %210, %74
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %214 = load i64, ptr @q, align 8, !tbaa !8
  %215 = icmp sgt i64 %214, %indvars.iv.next199
  br i1 %215, label %.lr.ph180, label %._crit_edge181, !llvm.loop !21
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef double @_ZSt4sqrtIxEN9__gnu_cxx11__enable_ifIXsr12__is_integerIT_EE7__valueEdE6__typeES2_(i64 noundef) local_unnamed_addr #5

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

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: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #6

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

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

attributes #0 = { 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 #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 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 = { 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 = { 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 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = distinct !{!14, !12}
!15 = !{!16, !16, i64 0}
!16 = !{!"int", !10, i64 0}
!17 = distinct !{!17, !12}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = distinct !{!20, !12}
!21 = distinct !{!21, !12}


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