; LLVM IR from tangjz/acm-icpc :: codeforces/gym/103957E.ll (Z5solvev)

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

%struct.FastInput = type <{ ptr, ptr, ptr, i8, [7 x i8] }>
%struct.FactorSet = type { i64, i32, i32, [13 x %"struct.std::pair"], [6721 x %"struct.std::pair"], [6721 x %"struct.std::pair.0"], %"class.std::unordered_map" }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.0" = type { i64, i64 }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.std::pair.6" = type <{ i64, i32, [4 x i8] }>

@in = external dso_local global %struct.FastInput, align 8
@R = external dso_local global %struct.FactorSet, align 8
@C = external dso_local global %struct.FactorSet, align 8
@RC = external dso_local global %struct.FactorSet, align 8
@_ZZ5solvevE4perm = external hidden global [10001 x i32], align 16
@_ZZ5solvevE3ctr = external hidden global [10001 x i32], align 16
@_ZZ5solvevE3com = external hidden global [241 x i32], align 16
@_ZZ5solvevE5coeff = external hidden global [6721 x %"struct.std::pair.6"], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6modPowix(i32 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 uwtable
declare dso_local noundef i32 @_Z6modInvi(i32 noundef) #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i64, align 8
  %11 = alloca %"struct.std::pair.6", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i64, align 8
  %18 = alloca i64, align 8
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  %21 = alloca ptr, align 8
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca ptr, align 8
  %26 = alloca ptr, align 8
  %27 = alloca ptr, align 8
  %28 = alloca ptr, align 8
  %29 = alloca ptr, align 8
  %30 = alloca i32, align 4
  %31 = alloca i64, align 8
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #4
  call void @_ZN9FastInput4readERi(ptr noundef nonnull align 8 dereferenceable(25) @in, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @_ZN9FastInput4readERi(ptr noundef nonnull align 8 dereferenceable(25) @in, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @_ZN9FastInput4readERi(ptr noundef nonnull align 8 dereferenceable(25) @in, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #4
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %47, %0
  %35 = load i32, ptr %4, align 4, !tbaa !5
  %36 = load i32, ptr %1, align 4, !tbaa !5
  %37 = icmp slt i32 %35, %36
  br i1 %37, label %39, label %38

38:                                               ; preds = %34
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #4
  br label %50

39:                                               ; preds = %34
  %40 = load i32, ptr %4, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %41
  call void @_ZN9FastInput4readERi(ptr noundef nonnull align 8 dereferenceable(25) @in, ptr noundef nonnull align 4 dereferenceable(4) %42)
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = add nsw i32 %43, 1
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE3ctr, i64 0, i64 %45
  store i32 0, ptr %46, align 4, !tbaa !5
  br label %47

47:                                               ; preds = %39
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr %4, align 4, !tbaa !5
  br label %34, !llvm.loop !9

50:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #4
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %51

51:                                               ; preds = %89, %50
  %52 = load i32, ptr %5, align 4, !tbaa !5
  %53 = load i32, ptr %1, align 4, !tbaa !5
  %54 = icmp slt i32 %52, %53
  br i1 %54, label %56, label %55

55:                                               ; preds = %51
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #4
  br label %92

56:                                               ; preds = %51
  %57 = load i32, ptr %5, align 4, !tbaa !5
  %58 = sext i32 %57 to i64
  %59 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %58
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp eq i32 %60, -1
  br i1 %61, label %62, label %63

62:                                               ; preds = %56
  br label %89

63:                                               ; preds = %56
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #4
  br label %64

64:                                               ; preds = %71, %63
  %65 = load i32, ptr %5, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %66
  %68 = load i32, ptr %67, align 4, !tbaa !5
  %69 = icmp ne i32 %68, -1
  br i1 %69, label %70, label %82

70:                                               ; preds = %64
  br label %71

71:                                               ; preds = %70
  %72 = load i32, ptr %6, align 4, !tbaa !5
  %73 = add nsw i32 %72, 1
  store i32 %73, ptr %6, align 4, !tbaa !5
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %75
  %77 = load i32, ptr %76, align 4, !tbaa !5
  store i32 %77, ptr %7, align 4, !tbaa !5
  %78 = load i32, ptr %5, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %79
  store i32 -1, ptr %80, align 4, !tbaa !5
  %81 = load i32, ptr %7, align 4, !tbaa !5
  store i32 %81, ptr %5, align 4, !tbaa !5
  br label %64, !llvm.loop !11

82:                                               ; preds = %64
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = load i32, ptr %6, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE3ctr, i64 0, i64 %85
  %87 = load i32, ptr %86, align 4, !tbaa !5
  %88 = add nsw i32 %87, %83
  store i32 %88, ptr %86, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #4
  br label %89

89:                                               ; preds = %82, %62
  %90 = load i32, ptr %5, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %5, align 4, !tbaa !5
  br label %51, !llvm.loop !12

92:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #4
  store i32 0, ptr %8, align 4, !tbaa !5
  %93 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN9FactorSet4initEii(ptr noundef nonnull align 8 dereferenceable(161480) @R, i32 noundef %93, i32 noundef 1)
  %94 = load i32, ptr %3, align 4, !tbaa !5
  call void @_ZN9FactorSet4initEii(ptr noundef nonnull align 8 dereferenceable(161480) @C, i32 noundef %94, i32 noundef 1)
  %95 = load i32, ptr %2, align 4, !tbaa !5
  %96 = load i32, ptr %3, align 4, !tbaa !5
  call void @_ZN9FactorSet4initEii(ptr noundef nonnull align 8 dereferenceable(161480) @RC, i32 noundef %95, i32 noundef %96)
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #4
  store i32 0, ptr %9, align 4, !tbaa !5
  br label %97

97:                                               ; preds = %125, %92
  %98 = load i32, ptr %9, align 4, !tbaa !5
  %99 = load i32, ptr getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 2), align 4, !tbaa !13
  %100 = icmp slt i32 %98, %99
  br i1 %100, label %102, label %101

101:                                              ; preds = %97
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #4
  br label %128

102:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #4
  %103 = load i32, ptr %9, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 5), i64 0, i64 %104
  %106 = getelementptr inbounds %"struct.std::pair.0", ptr %105, i32 0, i32 0
  %107 = load i64, ptr %106, align 8, !tbaa !23
  store i64 %107, ptr %10, align 8, !tbaa !25
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #4
  call void @_ZNSt4pairIxiEC2IxiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(12) %11)
  %108 = load i32, ptr %9, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %109
  %111 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt4pairIxiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(12) %110, ptr noundef nonnull align 8 dereferenceable(12) %11) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #4
  %112 = load i64, ptr %10, align 8, !tbaa !25
  %113 = load i32, ptr %1, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = icmp sle i64 %112, %114
  br i1 %115, label %116, label %124

116:                                              ; preds = %102
  %117 = load i64, ptr %10, align 8, !tbaa !25
  %118 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE3ctr, i64 0, i64 %117
  %119 = load i32, ptr %118, align 4, !tbaa !5
  %120 = load i32, ptr %9, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %121
  %123 = getelementptr inbounds %"struct.std::pair.6", ptr %122, i32 0, i32 1
  store i32 %119, ptr %123, align 8, !tbaa !26
  br label %124

124:                                              ; preds = %116, %102
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #4
  br label %125

125:                                              ; preds = %124
  %126 = load i32, ptr %9, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %9, align 4, !tbaa !5
  br label %97, !llvm.loop !28

128:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #4
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %129

129:                                              ; preds = %194, %128
  %130 = load i32, ptr %12, align 4, !tbaa !5
  %131 = load i32, ptr getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 1), align 8, !tbaa !29
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

133:                                              ; preds = %129
  store i32 14, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #4
  br label %197

134:                                              ; preds = %129
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #4
  %135 = load i32, ptr %12, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [13 x %"struct.std::pair"], ptr getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 3), i64 0, i64 %136
  %138 = getelementptr inbounds %"struct.std::pair", ptr %137, i32 0, i32 0
  %139 = load i32, ptr %138, align 8, !tbaa !30
  store i32 %139, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #4
  store i32 0, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #4
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %140

140:                                              ; preds = %190, %134
  %141 = load i32, ptr %15, align 4, !tbaa !5
  %142 = load i32, ptr getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 2), align 4, !tbaa !13
  %143 = icmp slt i32 %141, %142
  br i1 %143, label %145, label %144

144:                                              ; preds = %140
  store i32 17, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #4
  br label %193

145:                                              ; preds = %140
  call void @llvm.lifetime.start.p0(i64 8, ptr %17) #4
  %146 = load i32, ptr %15, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 5), i64 0, i64 %147
  %149 = getelementptr inbounds %"struct.std::pair.0", ptr %148, i32 0, i32 0
  %150 = load i64, ptr %149, align 8, !tbaa !23
  store i64 %150, ptr %17, align 8, !tbaa !25
  %151 = load i64, ptr %17, align 8, !tbaa !25
  %152 = load i32, ptr %14, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = srem i64 %151, %153
  %155 = icmp ne i64 %154, 0
  br i1 %155, label %156, label %157

156:                                              ; preds = %145
  store i32 19, ptr %13, align 4
  br label %187

157:                                              ; preds = %145
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #4
  %158 = load i64, ptr %17, align 8, !tbaa !25
  %159 = load i32, ptr %14, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = sdiv i64 %158, %160
  store i64 %161, ptr %18, align 8, !tbaa !25
  br label %162

162:                                              ; preds = %172, %157
  %163 = load i32, ptr %16, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 5), i64 0, i64 %164
  %166 = getelementptr inbounds %"struct.std::pair.0", ptr %165, i32 0, i32 0
  %167 = load i64, ptr %166, align 8, !tbaa !23
  %168 = load i64, ptr %18, align 8, !tbaa !25
  %169 = icmp ne i64 %167, %168
  br i1 %169, label %171, label %170

170:                                              ; preds = %162
  store i32 20, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #4
  br label %175

171:                                              ; preds = %162
  br label %172

172:                                              ; preds = %171
  %173 = load i32, ptr %16, align 4, !tbaa !5
  %174 = add nsw i32 %173, 1
  store i32 %174, ptr %16, align 4, !tbaa !5
  br label %162, !llvm.loop !32

175:                                              ; preds = %170
  %176 = load i32, ptr %16, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %177
  %179 = getelementptr inbounds %"struct.std::pair.6", ptr %178, i32 0, i32 1
  %180 = load i32, ptr %179, align 8, !tbaa !26
  %181 = load i32, ptr %15, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %182
  %184 = getelementptr inbounds %"struct.std::pair.6", ptr %183, i32 0, i32 1
  %185 = load i32, ptr %184, align 8, !tbaa !26
  %186 = add nsw i32 %185, %180
  store i32 %186, ptr %184, align 8, !tbaa !26
  store i32 0, ptr %13, align 4
  br label %187

187:                                              ; preds = %175, %156
  call void @llvm.lifetime.end.p0(i64 8, ptr %17) #4
  %188 = load i32, ptr %13, align 4
  switch i32 %188, label %367 [
    i32 0, label %189
    i32 19, label %190
  ]

189:                                              ; preds = %187
  br label %190

190:                                              ; preds = %189, %187
  %191 = load i32, ptr %15, align 4, !tbaa !5
  %192 = add nsw i32 %191, 1
  store i32 %192, ptr %15, align 4, !tbaa !5
  br label %140, !llvm.loop !33

193:                                              ; preds = %144
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #4
  br label %194

194:                                              ; preds = %193
  %195 = load i32, ptr %12, align 4, !tbaa !5
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %12, align 4, !tbaa !5
  br label %129, !llvm.loop !34

197:                                              ; preds = %133
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #4
  store i32 0, ptr %19, align 4, !tbaa !5
  br label %198

198:                                              ; preds = %300, %197
  %199 = load i32, ptr %19, align 4, !tbaa !5
  %200 = load i32, ptr getelementptr inbounds (%struct.FactorSet, ptr @R, i32 0, i32 2), align 4, !tbaa !13
  %201 = icmp slt i32 %199, %200
  br i1 %201, label %203, label %202

202:                                              ; preds = %198
  store i32 23, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #4
  br label %303

203:                                              ; preds = %198
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #4
  store i32 0, ptr %20, align 4, !tbaa !5
  br label %204

204:                                              ; preds = %296, %203
  %205 = load i32, ptr %20, align 4, !tbaa !5
  %206 = load i32, ptr getelementptr inbounds (%struct.FactorSet, ptr @C, i32 0, i32 2), align 4, !tbaa !13
  %207 = icmp slt i32 %205, %206
  br i1 %207, label %209, label %208

208:                                              ; preds = %204
  store i32 26, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #4
  br label %299

209:                                              ; preds = %204
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #4
  %210 = load i32, ptr %19, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (%struct.FactorSet, ptr @R, i32 0, i32 5), i64 0, i64 %211
  store ptr %212, ptr %21, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #4
  %213 = load ptr, ptr %21, align 8, !tbaa !35
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %213) #4
  store ptr %214, ptr %22, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #4
  %215 = load ptr, ptr %21, align 8, !tbaa !35
  %216 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %215) #4
  store ptr %216, ptr %23, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #4
  %217 = load i32, ptr %20, align 4, !tbaa !5
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (%struct.FactorSet, ptr @C, i32 0, i32 5), i64 0, i64 %218
  store ptr %219, ptr %24, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %25) #4
  %220 = load ptr, ptr %24, align 8, !tbaa !35
  %221 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %220) #4
  store ptr %221, ptr %25, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #4
  %222 = load ptr, ptr %24, align 8, !tbaa !35
  %223 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %222) #4
  store ptr %223, ptr %26, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #4
  %224 = load i32, ptr %20, align 4, !tbaa !5
  %225 = sext i32 %224 to i64
  %226 = getelementptr inbounds [6721 x %"struct.std::pair"], ptr getelementptr inbounds (%struct.FactorSet, ptr @C, i32 0, i32 4), i64 0, i64 %225
  store ptr %226, ptr %27, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #4
  %227 = load ptr, ptr %27, align 8, !tbaa !35
  %228 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiiERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %227) #4
  store ptr %228, ptr %28, align 8, !tbaa !35
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #4
  %229 = load ptr, ptr %27, align 8, !tbaa !35
  %230 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiiERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %229) #4
  store ptr %230, ptr %29, align 8, !tbaa !35
  %231 = load ptr, ptr %29, align 8, !tbaa !35
  %232 = load i32, ptr %231, align 4, !tbaa !5
  %233 = icmp sgt i32 %232, 1
  br i1 %233, label %234, label %266

234:                                              ; preds = %209
  %235 = load ptr, ptr %22, align 8, !tbaa !35
  %236 = load i64, ptr %235, align 8, !tbaa !25
  %237 = load ptr, ptr %28, align 8, !tbaa !35
  %238 = load i32, ptr %237, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [241 x i32], ptr @_ZZ5solvevE3com, i64 0, i64 %239
  %241 = load i32, ptr %240, align 4, !tbaa !5
  %242 = sext i32 %241 to i64
  %243 = sdiv i64 %236, %242
  %244 = load ptr, ptr %29, align 8, !tbaa !35
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = srem i64 %243, %246
  %248 = icmp eq i64 %247, 0
  br i1 %248, label %249, label %258

249:                                              ; preds = %234
  %250 = load ptr, ptr %28, align 8, !tbaa !35
  %251 = load i32, ptr %250, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [241 x i32], ptr @_ZZ5solvevE3com, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = load ptr, ptr %29, align 8, !tbaa !35
  %256 = load i32, ptr %255, align 4, !tbaa !5
  %257 = mul nsw i32 %254, %256
  br label %264

258:                                              ; preds = %234
  %259 = load ptr, ptr %28, align 8, !tbaa !35
  %260 = load i32, ptr %259, align 4, !tbaa !5
  %261 = sext i32 %260 to i64
  %262 = getelementptr inbounds [241 x i32], ptr @_ZZ5solvevE3com, i64 0, i64 %261
  %263 = load i32, ptr %262, align 4, !tbaa !5
  br label %264

264:                                              ; preds = %258, %249
  %265 = phi i32 [ %257, %249 ], [ %263, %258 ]
  br label %267

266:                                              ; preds = %209
  br label %267

267:                                              ; preds = %266, %264
  %268 = phi i32 [ %265, %264 ], [ 1, %266 ]
  %269 = load i32, ptr %20, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [241 x i32], ptr @_ZZ5solvevE3com, i64 0, i64 %270
  store i32 %268, ptr %271, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr %31) #4
  %272 = load ptr, ptr %22, align 8, !tbaa !35
  %273 = load i64, ptr %272, align 8, !tbaa !25
  %274 = load i32, ptr %20, align 4, !tbaa !5
  %275 = sext i32 %274 to i64
  %276 = getelementptr inbounds [241 x i32], ptr @_ZZ5solvevE3com, i64 0, i64 %275
  %277 = load i32, ptr %276, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = sdiv i64 %273, %278
  %280 = load ptr, ptr %25, align 8, !tbaa !35
  %281 = load i64, ptr %280, align 8, !tbaa !25
  %282 = mul nsw i64 %279, %281
  store i64 %282, ptr %31, align 8, !tbaa !25
  %283 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(56) getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 6), ptr noundef nonnull align 8 dereferenceable(8) %31)
  %284 = load i32, ptr %283, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %31) #4
  store i32 %284, ptr %30, align 4, !tbaa !5
  %285 = load ptr, ptr %23, align 8, !tbaa !35
  %286 = load i64, ptr %285, align 8, !tbaa !25
  %287 = load ptr, ptr %26, align 8, !tbaa !35
  %288 = load i64, ptr %287, align 8, !tbaa !25
  %289 = mul nsw i64 %286, %288
  %290 = load i32, ptr %30, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %291
  %293 = getelementptr inbounds %"struct.std::pair.6", ptr %292, i32 0, i32 0
  %294 = load i64, ptr %293, align 16, !tbaa !36
  %295 = add nsw i64 %294, %289
  store i64 %295, ptr %293, align 16, !tbaa !36
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %25) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #4
  br label %296

296:                                              ; preds = %267
  %297 = load i32, ptr %20, align 4, !tbaa !5
  %298 = add nsw i32 %297, 1
  store i32 %298, ptr %20, align 4, !tbaa !5
  br label %204, !llvm.loop !37

299:                                              ; preds = %208
  br label %300

300:                                              ; preds = %299
  %301 = load i32, ptr %19, align 4, !tbaa !5
  %302 = add nsw i32 %301, 1
  store i32 %302, ptr %19, align 4, !tbaa !5
  br label %198, !llvm.loop !38

303:                                              ; preds = %202
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #4
  store i32 0, ptr %32, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #4
  store i32 0, ptr %33, align 4, !tbaa !5
  br label %304

304:                                              ; preds = %351, %303
  %305 = load i32, ptr %33, align 4, !tbaa !5
  %306 = load i32, ptr getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 2), align 4, !tbaa !13
  %307 = icmp slt i32 %305, %306
  br i1 %307, label %309, label %308

308:                                              ; preds = %304
  store i32 29, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #4
  br label %354

309:                                              ; preds = %304
  %310 = load i32, ptr %33, align 4, !tbaa !5
  %311 = sext i32 %310 to i64
  %312 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %311
  %313 = getelementptr inbounds %"struct.std::pair.6", ptr %312, i32 0, i32 0
  %314 = load i64, ptr %313, align 16, !tbaa !36
  %315 = srem i64 %314, 1000000007
  store i64 %315, ptr %313, align 16, !tbaa !36
  %316 = icmp ne i64 %315, 0
  br i1 %316, label %317, label %350

317:                                              ; preds = %309
  %318 = load i32, ptr %33, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %319
  %321 = getelementptr inbounds %"struct.std::pair.6", ptr %320, i32 0, i32 1
  %322 = load i32, ptr %321, align 8, !tbaa !26
  %323 = icmp ne i32 %322, 0
  br i1 %323, label %324, label %350

324:                                              ; preds = %317
  %325 = load i32, ptr %32, align 4, !tbaa !5
  %326 = sext i32 %325 to i64
  %327 = load i32, ptr %33, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %328
  %330 = getelementptr inbounds %"struct.std::pair.6", ptr %329, i32 0, i32 0
  %331 = load i64, ptr %330, align 16, !tbaa !36
  %332 = load i32, ptr %33, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %333
  %335 = getelementptr inbounds %"struct.std::pair.6", ptr %334, i32 0, i32 1
  %336 = load i32, ptr %335, align 8, !tbaa !26
  %337 = load i64, ptr @RC, align 8, !tbaa !39
  %338 = load i32, ptr %33, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (%struct.FactorSet, ptr @RC, i32 0, i32 5), i64 0, i64 %339
  %341 = getelementptr inbounds %"struct.std::pair.0", ptr %340, i32 0, i32 0
  %342 = load i64, ptr %341, align 8, !tbaa !23
  %343 = sdiv i64 %337, %342
  %344 = call noundef i32 @_Z6modPowix(i32 noundef %336, i64 noundef %343)
  %345 = sext i32 %344 to i64
  %346 = mul nsw i64 %331, %345
  %347 = add nsw i64 %326, %346
  %348 = srem i64 %347, 1000000007
  %349 = trunc i64 %348 to i32
  store i32 %349, ptr %32, align 4, !tbaa !5
  br label %350

350:                                              ; preds = %324, %317, %309
  br label %351

351:                                              ; preds = %350
  %352 = load i32, ptr %33, align 4, !tbaa !5
  %353 = add nsw i32 %352, 1
  store i32 %353, ptr %33, align 4, !tbaa !5
  br label %304, !llvm.loop !40

354:                                              ; preds = %308
  %355 = load i32, ptr %32, align 4, !tbaa !5
  %356 = sext i32 %355 to i64
  %357 = load i64, ptr @RC, align 8, !tbaa !39
  %358 = srem i64 %357, 1000000007
  %359 = trunc i64 %358 to i32
  %360 = call noundef i32 @_Z6modInvi(i32 noundef %359)
  %361 = sext i32 %360 to i64
  %362 = mul nsw i64 %356, %361
  %363 = srem i64 %362, 1000000007
  %364 = trunc i64 %363 to i32
  store i32 %364, ptr %32, align 4, !tbaa !5
  %365 = load i32, ptr %32, align 4, !tbaa !5
  %366 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %365)
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr %1) #4
  ret void

367:                                              ; preds = %187
  unreachable
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9FactorSet4initEii(ptr noundef nonnull align 8 dereferenceable(161480), i32 noundef, i32 noundef) #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) #0

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

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

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

declare i32 @printf(ptr noundef, ...) #3

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 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 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = distinct !{!11, !10}
!12 = distinct !{!12, !10}
!13 = !{!14, !6, i64 12}
!14 = !{!"_ZTS9FactorSet", !15, i64 0, !6, i64 8, !6, i64 12, !7, i64 16, !7, i64 120, !7, i64 53888, !16, i64 161424}
!15 = !{!"long long", !7, i64 0}
!16 = !{!"_ZTSSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE", !17, i64 0}
!17 = !{!"_ZTSSt10_HashtableIxSt4pairIKxiESaIS2_ENSt8__detail10_Select1stESt8equal_toIxESt4hashIxENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !18, i64 0, !19, i64 8, !20, i64 16, !19, i64 24, !21, i64 32, !18, i64 48}
!18 = !{!"any pointer", !7, i64 0}
!19 = !{!"long", !7, i64 0}
!20 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !18, i64 0}
!21 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !22, i64 0, !19, i64 8}
!22 = !{!"float", !7, i64 0}
!23 = !{!24, !15, i64 0}
!24 = !{!"_ZTSSt4pairIxxE", !15, i64 0, !15, i64 8}
!25 = !{!15, !15, i64 0}
!26 = !{!27, !6, i64 8}
!27 = !{!"_ZTSSt4pairIxiE", !15, i64 0, !6, i64 8}
!28 = distinct !{!28, !10}
!29 = !{!14, !6, i64 8}
!30 = !{!31, !6, i64 0}
!31 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !10}
!34 = distinct !{!34, !10}
!35 = !{!18, !18, i64 0}
!36 = !{!27, !15, i64 0}
!37 = distinct !{!37, !10}
!38 = distinct !{!38, !10}
!39 = !{!14, !15, i64 0}
!40 = distinct !{!40, !10}


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

%struct.FastInput = type <{ ptr, ptr, ptr, i8, [7 x i8] }>
%struct.FactorSet = type { i64, i32, i32, [13 x %"struct.std::pair"], [6721 x %"struct.std::pair"], [6721 x %"struct.std::pair.0"], %"class.std::unordered_map" }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.0" = type { i64, i64 }
%"class.std::unordered_map" = type { %"class.std::_Hashtable" }
%"class.std::_Hashtable" = type { ptr, i64, %"struct.std::__detail::_Hash_node_base", i64, %"struct.std::__detail::_Prime_rehash_policy", ptr }
%"struct.std::__detail::_Hash_node_base" = type { ptr }
%"struct.std::__detail::_Prime_rehash_policy" = type { float, i64 }
%"struct.std::pair.6" = type <{ i64, i32, [4 x i8] }>

@in = external dso_local global %struct.FastInput, align 8
@R = external dso_local global %struct.FactorSet, align 8
@C = external dso_local global %struct.FactorSet, align 8
@RC = external dso_local global %struct.FactorSet, align 8
@_ZZ5solvevE4perm = external hidden global [10001 x i32], align 16
@_ZZ5solvevE3ctr = external hidden local_unnamed_addr global [10001 x i32], align 16
@_ZZ5solvevE3com = external hidden local_unnamed_addr global [241 x i32], align 16
@_ZZ5solvevE5coeff = external hidden global [6721 x %"struct.std::pair.6"], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z6modPowix(i32 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 uwtable
declare dso_local noundef i32 @_Z6modInvi(i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solvev() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair.6", align 8
  %5 = alloca i64, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #4
  call void @_ZN9FastInput4readERi(ptr noundef nonnull align 8 dereferenceable(25) @in, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @_ZN9FastInput4readERi(ptr noundef nonnull align 8 dereferenceable(25) @in, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @_ZN9FastInput4readERi(ptr noundef nonnull align 8 dereferenceable(25) @in, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %6 = load i32, ptr %1, align 4, !tbaa !5
  %7 = icmp sgt i32 %6, 0
  br i1 %7, label %.lr.ph, label %._crit_edge110

.preheader99:                                     ; preds = %.lr.ph
  %8 = icmp sgt i32 %11, 0
  br i1 %8, label %.lr.ph109, label %._crit_edge110

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 0, %0 ]
  %9 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %indvars.iv
  call void @_ZN9FastInput4readERi(ptr noundef nonnull align 8 dereferenceable(25) @in, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %10 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE3ctr, i64 0, i64 %indvars.iv.next
  store i32 0, ptr %10, align 4, !tbaa !5
  %11 = load i32, ptr %1, align 4, !tbaa !5
  %12 = sext i32 %11 to i64
  %13 = icmp slt i64 %indvars.iv.next, %12
  br i1 %13, label %.lr.ph, label %.preheader99, !llvm.loop !9

._crit_edge110:                                   ; preds = %34, %0, %.preheader99
  %14 = load i32, ptr %2, align 4, !tbaa !5
  call void @_ZN9FactorSet4initEii(ptr noundef nonnull align 8 dereferenceable(161480) @R, i32 noundef %14, i32 noundef 1)
  %15 = load i32, ptr %3, align 4, !tbaa !5
  call void @_ZN9FactorSet4initEii(ptr noundef nonnull align 8 dereferenceable(161480) @C, i32 noundef %15, i32 noundef 1)
  %16 = load i32, ptr %2, align 4, !tbaa !5
  %17 = load i32, ptr %3, align 4, !tbaa !5
  call void @_ZN9FactorSet4initEii(ptr noundef nonnull align 8 dereferenceable(161480) @RC, i32 noundef %16, i32 noundef %17)
  %18 = load i32, ptr getelementptr inbounds (i8, ptr @RC, i64 12), align 4, !tbaa !11
  %19 = icmp sgt i32 %18, 0
  br i1 %19, label %.lr.ph113, label %.preheader97

.lr.ph109:                                        ; preds = %.preheader99, %34
  %.074108 = phi i32 [ %35, %34 ], [ 0, %.preheader99 ]
  %20 = sext i32 %.074108 to i64
  %21 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %20
  %22 = load i32, ptr %21, align 4, !tbaa !5
  %23 = icmp eq i32 %22, -1
  br i1 %23, label %34, label %.lr.ph105

.lr.ph105:                                        ; preds = %.lr.ph109, %.lr.ph105
  %24 = phi i32 [ %29, %.lr.ph105 ], [ %22, %.lr.ph109 ]
  %25 = phi ptr [ %28, %.lr.ph105 ], [ %21, %.lr.ph109 ]
  %.076104 = phi i32 [ %26, %.lr.ph105 ], [ 0, %.lr.ph109 ]
  %26 = add nuw nsw i32 %.076104, 1
  store i32 -1, ptr %25, align 4, !tbaa !5
  %27 = sext i32 %24 to i64
  %28 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE4perm, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %.not94 = icmp eq i32 %29, -1
  br i1 %.not94, label %._crit_edge, label %.lr.ph105, !llvm.loop !21

._crit_edge:                                      ; preds = %.lr.ph105
  %30 = zext nneg i32 %26 to i64
  %31 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE3ctr, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = add nsw i32 %32, %26
  store i32 %33, ptr %31, align 4, !tbaa !5
  br label %34

34:                                               ; preds = %.lr.ph109, %._crit_edge
  %.2 = phi i32 [ %.074108, %.lr.ph109 ], [ %24, %._crit_edge ]
  %35 = add nsw i32 %.2, 1
  %36 = icmp slt i32 %35, %11
  br i1 %36, label %.lr.ph109, label %._crit_edge110, !llvm.loop !22

.preheader97:                                     ; preds = %71, %._crit_edge110
  %.lcssa100 = phi i32 [ %18, %._crit_edge110 ], [ %72, %71 ]
  %37 = load i32, ptr getelementptr inbounds (i8, ptr @RC, i64 8), align 8, !tbaa !23
  %38 = icmp sgt i32 %37, 0
  %39 = icmp sgt i32 %.lcssa100, 0
  %or.cond = and i1 %38, %39
  br i1 %or.cond, label %.lr.ph118.us.preheader, label %.preheader96

.lr.ph118.us.preheader:                           ; preds = %.preheader97
  %wide.trip.count150 = zext nneg i32 %37 to i64
  %wide.trip.count = zext nneg i32 %.lcssa100 to i64
  br label %.lr.ph118.us

.lr.ph118.us:                                     ; preds = %.lr.ph118.us.preheader, %._crit_edge119.us
  %indvars.iv147 = phi i64 [ 0, %.lr.ph118.us.preheader ], [ %indvars.iv.next148, %._crit_edge119.us ]
  %40 = getelementptr inbounds [13 x %"struct.std::pair"], ptr getelementptr inbounds (i8, ptr @RC, i64 16), i64 0, i64 %indvars.iv147
  %41 = load i32, ptr %40, align 8, !tbaa !24
  %42 = sext i32 %41 to i64
  br label %43

43:                                               ; preds = %.lr.ph118.us, %60
  %indvars.iv144 = phi i64 [ 0, %.lr.ph118.us ], [ %indvars.iv.next145, %60 ]
  %.080115.us = phi i32 [ 0, %.lr.ph118.us ], [ %.282.us, %60 ]
  %44 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (i8, ptr @RC, i64 53888), i64 0, i64 %indvars.iv144
  %45 = load i64, ptr %44, align 8, !tbaa !26
  %46 = srem i64 %45, %42
  %47 = sdiv i64 %45, %42
  %.not91.us = icmp eq i64 %46, 0
  br i1 %.not91.us, label %48, label %60

48:                                               ; preds = %43
  %49 = sext i32 %.080115.us to i64
  br label %50

50:                                               ; preds = %50, %48
  %indvars.iv141 = phi i64 [ %indvars.iv.next142, %50 ], [ %49, %48 ]
  %51 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (i8, ptr @RC, i64 53888), i64 0, i64 %indvars.iv141
  %52 = load i64, ptr %51, align 8, !tbaa !26
  %.not92.us = icmp eq i64 %52, %47
  %indvars.iv.next142 = add nsw i64 %indvars.iv141, 1
  br i1 %.not92.us, label %53, label %50, !llvm.loop !28

53:                                               ; preds = %50
  %54 = trunc nsw i64 %indvars.iv141 to i32
  %55 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %indvars.iv141, i32 1
  %56 = load i32, ptr %55, align 8, !tbaa !29
  %57 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %indvars.iv144, i32 1
  %58 = load i32, ptr %57, align 8, !tbaa !29
  %59 = add nsw i32 %58, %56
  store i32 %59, ptr %57, align 8, !tbaa !29
  br label %60

60:                                               ; preds = %53, %43
  %.282.us = phi i32 [ %54, %53 ], [ %.080115.us, %43 ]
  %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next145, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge119.us, label %43, !llvm.loop !31

._crit_edge119.us:                                ; preds = %60
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %exitcond151.not = icmp eq i64 %indvars.iv.next148, %wide.trip.count150
  br i1 %exitcond151.not, label %.preheader96, label %.lr.ph118.us, !llvm.loop !32

.lr.ph113:                                        ; preds = %._crit_edge110, %71
  %indvars.iv138 = phi i64 [ %indvars.iv.next139, %71 ], [ 0, %._crit_edge110 ]
  %61 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (i8, ptr @RC, i64 53888), i64 0, i64 %indvars.iv138
  %62 = load i64, ptr %61, align 8, !tbaa !26
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #4
  call void @_ZNSt4pairIxiEC2IxiTnNSt9enable_ifIXsr6__and_ISt37__is_implicitly_default_constructibleIT_ES3_IT0_EEE5valueEbE4typeELb1EEEv(ptr noundef nonnull align 8 dereferenceable(12) %4)
  %63 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %indvars.iv138
  %64 = call noundef nonnull align 8 dereferenceable(12) ptr @_ZNSt4pairIxiEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(12) %63, ptr noundef nonnull align 8 dereferenceable(12) %4) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #4
  %65 = load i32, ptr %1, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %.not93 = icmp sgt i64 %62, %66
  br i1 %.not93, label %71, label %67

67:                                               ; preds = %.lr.ph113
  %68 = getelementptr inbounds [10001 x i32], ptr @_ZZ5solvevE3ctr, i64 0, i64 %62
  %69 = load i32, ptr %68, align 4, !tbaa !5
  %70 = getelementptr inbounds i8, ptr %63, i64 8
  store i32 %69, ptr %70, align 8, !tbaa !29
  br label %71

71:                                               ; preds = %67, %.lr.ph113
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 1
  %72 = load i32, ptr getelementptr inbounds (i8, ptr @RC, i64 12), align 4, !tbaa !11
  %73 = sext i32 %72 to i64
  %74 = icmp slt i64 %indvars.iv.next139, %73
  br i1 %74, label %.lr.ph113, label %.preheader97, !llvm.loop !33

.preheader96:                                     ; preds = %._crit_edge119.us, %.preheader97
  %75 = load i32, ptr getelementptr inbounds (i8, ptr @R, i64 12), align 4, !tbaa !11
  %76 = icmp sgt i32 %75, 0
  %77 = load i32, ptr getelementptr inbounds (i8, ptr @C, i64 12), align 4
  %78 = icmp sgt i32 %77, 0
  %or.cond170 = select i1 %76, i1 %78, i1 false
  br i1 %or.cond170, label %.preheader95, label %.preheader

.preheader95:                                     ; preds = %.preheader96, %._crit_edge124
  %79 = phi i32 [ %85, %._crit_edge124 ], [ %75, %.preheader96 ]
  %80 = phi i32 [ %86, %._crit_edge124 ], [ %77, %.preheader96 ]
  %indvars.iv155 = phi i64 [ %indvars.iv.next156, %._crit_edge124 ], [ 0, %.preheader96 ]
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.lr.ph123, label %._crit_edge124

.lr.ph123:                                        ; preds = %.preheader95
  %82 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (i8, ptr @R, i64 53888), i64 0, i64 %indvars.iv155
  br label %89

.preheader.loopexit:                              ; preds = %._crit_edge124
  %.pre162 = load i32, ptr getelementptr inbounds (i8, ptr @RC, i64 12), align 4, !tbaa !11
  br label %.preheader

.preheader:                                       ; preds = %.preheader.loopexit, %.preheader96
  %83 = phi i32 [ %.pre162, %.preheader.loopexit ], [ %.lcssa100, %.preheader96 ]
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %.lr.ph128, label %._crit_edge129

._crit_edge124.loopexit:                          ; preds = %111
  %.pre161 = load i32, ptr getelementptr inbounds (i8, ptr @R, i64 12), align 4, !tbaa !11
  br label %._crit_edge124

._crit_edge124:                                   ; preds = %._crit_edge124.loopexit, %.preheader95
  %85 = phi i32 [ %.pre161, %._crit_edge124.loopexit ], [ %79, %.preheader95 ]
  %86 = phi i32 [ %127, %._crit_edge124.loopexit ], [ %80, %.preheader95 ]
  %indvars.iv.next156 = add nuw nsw i64 %indvars.iv155, 1
  %87 = sext i32 %85 to i64
  %88 = icmp slt i64 %indvars.iv.next156, %87
  br i1 %88, label %.preheader95, label %.preheader.loopexit, !llvm.loop !34

89:                                               ; preds = %.lr.ph123, %111
  %indvars.iv152 = phi i64 [ 0, %.lr.ph123 ], [ %indvars.iv.next153, %111 ]
  %90 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %82) #4
  %91 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %82) #4
  %92 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (i8, ptr @C, i64 53888), i64 0, i64 %indvars.iv152
  %93 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %92) #4
  %94 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16) %92) #4
  %95 = getelementptr inbounds [6721 x %"struct.std::pair"], ptr getelementptr inbounds (i8, ptr @C, i64 120), i64 0, i64 %indvars.iv152
  %96 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EiiERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %95) #4
  %97 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EiiERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %95) #4
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp sgt i32 %98, 1
  %.pre = load i64, ptr %90, align 8, !tbaa !36
  br i1 %99, label %100, label %111

100:                                              ; preds = %89
  %101 = load i32, ptr %96, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds [241 x i32], ptr @_ZZ5solvevE3com, i64 0, i64 %102
  %104 = load i32, ptr %103, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = sdiv i64 %.pre, %105
  %107 = zext nneg i32 %98 to i64
  %108 = srem i64 %106, %107
  %109 = icmp eq i64 %108, 0
  %110 = select i1 %109, i32 %98, i32 1
  %spec.select = mul nsw i32 %110, %104
  br label %111

111:                                              ; preds = %100, %89
  %112 = phi i32 [ 1, %89 ], [ %spec.select, %100 ]
  %113 = getelementptr inbounds [241 x i32], ptr @_ZZ5solvevE3com, i64 0, i64 %indvars.iv152
  store i32 %112, ptr %113, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #4
  %114 = sext i32 %112 to i64
  %115 = sdiv i64 %.pre, %114
  %116 = load i64, ptr %93, align 8, !tbaa !36
  %117 = mul nsw i64 %116, %115
  store i64 %117, ptr %5, align 8, !tbaa !36
  %118 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEEixEOx(ptr noundef nonnull align 8 dereferenceable(56) getelementptr inbounds (i8, ptr @RC, i64 161424), ptr noundef nonnull align 8 dereferenceable(8) %5)
  %119 = load i32, ptr %118, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #4
  %120 = load i64, ptr %91, align 8, !tbaa !36
  %121 = load i64, ptr %94, align 8, !tbaa !36
  %122 = mul nsw i64 %121, %120
  %123 = sext i32 %119 to i64
  %124 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %123
  %125 = load i64, ptr %124, align 16, !tbaa !37
  %126 = add nsw i64 %125, %122
  store i64 %126, ptr %124, align 16, !tbaa !37
  %indvars.iv.next153 = add nuw nsw i64 %indvars.iv152, 1
  %127 = load i32, ptr getelementptr inbounds (i8, ptr @C, i64 12), align 4, !tbaa !11
  %128 = sext i32 %127 to i64
  %129 = icmp slt i64 %indvars.iv.next153, %128
  br i1 %129, label %89, label %._crit_edge124.loopexit, !llvm.loop !38

._crit_edge129.loopexit:                          ; preds = %159
  %130 = sext i32 %.1 to i64
  br label %._crit_edge129

._crit_edge129:                                   ; preds = %._crit_edge129.loopexit, %.preheader
  %.072.lcssa = phi i64 [ 0, %.preheader ], [ %130, %._crit_edge129.loopexit ]
  %131 = load i64, ptr @RC, align 8, !tbaa !39
  %132 = srem i64 %131, 1000000007
  %133 = trunc nsw i64 %132 to i32
  %134 = call noundef i32 @_Z6modInvi(i32 noundef %133)
  %135 = sext i32 %134 to i64
  %136 = mul nsw i64 %.072.lcssa, %135
  %137 = srem i64 %136, 1000000007
  %138 = trunc nsw i64 %137 to i32
  %139 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %138)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #4
  ret void

.lr.ph128:                                        ; preds = %.preheader, %159
  %140 = phi i32 [ %160, %159 ], [ %83, %.preheader ]
  %indvars.iv158 = phi i64 [ %indvars.iv.next159, %159 ], [ 0, %.preheader ]
  %.072126 = phi i32 [ %.1, %159 ], [ 0, %.preheader ]
  %141 = getelementptr inbounds [6721 x %"struct.std::pair.6"], ptr @_ZZ5solvevE5coeff, i64 0, i64 %indvars.iv158
  %142 = load i64, ptr %141, align 16, !tbaa !37
  %143 = srem i64 %142, 1000000007
  store i64 %143, ptr %141, align 16, !tbaa !37
  %.not = icmp eq i64 %143, 0
  br i1 %.not, label %159, label %144

144:                                              ; preds = %.lr.ph128
  %145 = getelementptr inbounds i8, ptr %141, i64 8
  %146 = load i32, ptr %145, align 8, !tbaa !29
  %.not90 = icmp eq i32 %146, 0
  br i1 %.not90, label %159, label %147

147:                                              ; preds = %144
  %148 = sext i32 %.072126 to i64
  %149 = load i64, ptr @RC, align 8, !tbaa !39
  %150 = getelementptr inbounds [6721 x %"struct.std::pair.0"], ptr getelementptr inbounds (i8, ptr @RC, i64 53888), i64 0, i64 %indvars.iv158
  %151 = load i64, ptr %150, align 8, !tbaa !26
  %152 = sdiv i64 %149, %151
  %153 = call noundef i32 @_Z6modPowix(i32 noundef %146, i64 noundef %152)
  %154 = sext i32 %153 to i64
  %155 = mul nsw i64 %143, %154
  %156 = add nsw i64 %155, %148
  %157 = srem i64 %156, 1000000007
  %158 = trunc nsw i64 %157 to i32
  %.pre163 = load i32, ptr getelementptr inbounds (i8, ptr @RC, i64 12), align 4, !tbaa !11
  br label %159

159:                                              ; preds = %.lr.ph128, %144, %147
  %160 = phi i32 [ %.pre163, %147 ], [ %140, %144 ], [ %140, %.lr.ph128 ]
  %.1 = phi i32 [ %158, %147 ], [ %.072126, %144 ], [ %.072126, %.lr.ph128 ]
  %indvars.iv.next159 = add nuw nsw i64 %indvars.iv158, 1
  %161 = sext i32 %160 to i64
  %162 = icmp slt i64 %indvars.iv.next159, %161
  br i1 %162, label %.lr.ph128, label %._crit_edge129.loopexit, !llvm.loop !40
}

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN9FactorSet4initEii(ptr noundef nonnull align 8 dereferenceable(161480), i32 noundef, i32 noundef) local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm0ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3getILm1ExxERNSt13tuple_elementIXT_ESt4pairIT0_T1_EE4typeERS4_(ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0

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

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @printf(ptr nocapture noundef readonly, ...) local_unnamed_addr #3

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 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 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"int", !7, i64 0}
!7 = !{!"omnipotent char", !8, i64 0}
!8 = !{!"Simple C++ TBAA"}
!9 = distinct !{!9, !10}
!10 = !{!"llvm.loop.mustprogress"}
!11 = !{!12, !6, i64 12}
!12 = !{!"_ZTS9FactorSet", !13, i64 0, !6, i64 8, !6, i64 12, !7, i64 16, !7, i64 120, !7, i64 53888, !14, i64 161424}
!13 = !{!"long long", !7, i64 0}
!14 = !{!"_ZTSSt13unordered_mapIxiSt4hashIxESt8equal_toIxESaISt4pairIKxiEEE", !15, i64 0}
!15 = !{!"_ZTSSt10_HashtableIxSt4pairIKxiESaIS2_ENSt8__detail10_Select1stESt8equal_toIxESt4hashIxENS4_18_Mod_range_hashingENS4_20_Default_ranged_hashENS4_20_Prime_rehash_policyENS4_17_Hashtable_traitsILb0ELb0ELb1EEEE", !16, i64 0, !17, i64 8, !18, i64 16, !17, i64 24, !19, i64 32, !16, i64 48}
!16 = !{!"any pointer", !7, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = !{!"_ZTSNSt8__detail15_Hash_node_baseE", !16, i64 0}
!19 = !{!"_ZTSNSt8__detail20_Prime_rehash_policyE", !20, i64 0, !17, i64 8}
!20 = !{!"float", !7, i64 0}
!21 = distinct !{!21, !10}
!22 = distinct !{!22, !10}
!23 = !{!12, !6, i64 8}
!24 = !{!25, !6, i64 0}
!25 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!26 = !{!27, !13, i64 0}
!27 = !{!"_ZTSSt4pairIxxE", !13, i64 0, !13, i64 8}
!28 = distinct !{!28, !10}
!29 = !{!30, !6, i64 8}
!30 = !{!"_ZTSSt4pairIxiE", !13, i64 0, !6, i64 8}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !10}
!34 = distinct !{!34, !10, !35}
!35 = !{!"llvm.loop.unswitch.partial.disable"}
!36 = !{!13, !13, i64 0}
!37 = !{!30, !13, i64 0}
!38 = distinct !{!38, !10}
!39 = !{!12, !13, i64 0}
!40 = distinct !{!40, !10}


; Effective O3 passes: CorrelatedValuePropagationPass,DivRemPairsPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass