; LLVM IR from tangjz/acm-icpc :: 51nod (1024)

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

@Gcd = external dso_local global [9 x [9 x i32]], align 16
@tot = external dso_local global i32, align 4
@pL = external dso_local global [9 x i32], align 16
@pR = external dso_local global [9 x i32], align 16
@low = external dso_local global [9 x i32], align 16
@upp = external dso_local global [9 x i32], align 16
@pos = external dso_local global [19 x i32], align 16
@tp = external dso_local global [9 x i32], align 16
@sp = external dso_local global [19 x i32], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5solveiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5iRootii(i32 noundef, i32 noundef) #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %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 i32, align 4
  %11 = alloca i32, align 4
  %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 i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #7
  %18 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %6, ptr noundef %4, ptr noundef %3, ptr noundef %5)
  %19 = load i32, ptr %3, align 4, !tbaa !5
  %20 = sub nsw i32 %19, 1
  %21 = load i32, ptr %4, align 4, !tbaa !5
  %22 = add nsw i32 %21, %20
  store i32 %22, ptr %4, align 4, !tbaa !5
  %23 = load i32, ptr %5, align 4, !tbaa !5
  %24 = sub nsw i32 %23, 1
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = add nsw i32 %25, %24
  store i32 %26, ptr %6, align 4, !tbaa !5
  %27 = load i32, ptr @tot, align 4, !tbaa !5
  %28 = add nsw i32 %27, 1
  store i32 %28, ptr @tot, align 4, !tbaa !5
  %29 = sext i32 %27 to i64
  %30 = getelementptr inbounds [19 x i32], ptr @pos, i64 0, i64 %29
  store i32 1, ptr %30, align 4, !tbaa !5
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %66, %0
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = shl i32 1, %32
  %34 = load i32, ptr %4, align 4, !tbaa !5
  %35 = icmp sle i32 %33, %34
  br i1 %35, label %36, label %69

36:                                               ; preds = %31
  %37 = load i32, ptr %3, align 4, !tbaa !5
  %38 = sub nsw i32 %37, 1
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = call noundef i32 @_Z5iRootii(i32 noundef %38, i32 noundef %39)
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [9 x i32], ptr @low, i64 0, i64 %42
  store i32 %40, ptr %43, align 4, !tbaa !5
  %44 = load i32, ptr @tot, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr @tot, align 4, !tbaa !5
  %46 = sext i32 %44 to i64
  %47 = getelementptr inbounds [19 x i32], ptr @pos, i64 0, i64 %46
  store i32 %40, ptr %47, align 4, !tbaa !5
  %48 = load i32, ptr %4, align 4, !tbaa !5
  %49 = load i32, ptr %2, align 4, !tbaa !5
  %50 = call noundef i32 @_Z5iRootii(i32 noundef %48, i32 noundef %49)
  %51 = load i32, ptr %2, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [9 x i32], ptr @upp, i64 0, i64 %52
  store i32 %50, ptr %53, align 4, !tbaa !5
  %54 = load i32, ptr @tot, align 4, !tbaa !5
  %55 = add nsw i32 %54, 1
  store i32 %55, ptr @tot, align 4, !tbaa !5
  %56 = sext i32 %54 to i64
  %57 = getelementptr inbounds [19 x i32], ptr @pos, i64 0, i64 %56
  store i32 %50, ptr %57, align 4, !tbaa !5
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = load i32, ptr %2, align 4, !tbaa !5
  %60 = sext i32 %59 to i64
  %61 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %60
  %62 = getelementptr inbounds [9 x i32], ptr %61, i64 0, i64 0
  store i32 %58, ptr %62, align 4, !tbaa !5
  %63 = load i32, ptr %2, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [9 x i32], ptr @Gcd, i64 0, i64 %64
  store i32 %58, ptr %65, align 4, !tbaa !5
  br label %66

66:                                               ; preds = %36
  %67 = load i32, ptr %2, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr %2, align 4, !tbaa !5
  br label %31, !llvm.loop !9

69:                                               ; preds = %31
  %70 = load i32, ptr @tot, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr @pos, i64 %71
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @pos, ptr noundef %72)
  %73 = load i32, ptr @tot, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr @pos, i64 %74
  %76 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @pos, ptr noundef %75)
  %77 = ptrtoint ptr %76 to i64
  %78 = sub i64 %77, ptrtoint (ptr @pos to i64)
  %79 = sdiv exact i64 %78, 4
  %80 = trunc i64 %79 to i32
  store i32 %80, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #7
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %81

81:                                               ; preds = %154, %69
  %82 = load i32, ptr %7, align 4, !tbaa !5
  %83 = load i32, ptr @tot, align 4, !tbaa !5
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %86, label %85

85:                                               ; preds = %81
  store i32 5, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #7
  br label %157

86:                                               ; preds = %81
  %87 = load i32, ptr %7, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [9 x i32], ptr @pL, i64 0, i64 %88
  store i32 9, ptr %89, align 4, !tbaa !5
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [9 x i32], ptr @pR, i64 0, i64 %91
  store i32 0, ptr %92, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #7
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %93

93:                                               ; preds = %112, %86
  %94 = load i32, ptr %9, align 4, !tbaa !5
  %95 = shl i32 1, %94
  %96 = load i32, ptr %7, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [19 x i32], ptr @pos, i64 0, i64 %97
  %99 = load i32, ptr %98, align 4, !tbaa !5
  %100 = icmp sle i32 %95, %99
  br i1 %100, label %101, label %115

101:                                              ; preds = %93
  %102 = load i32, ptr %7, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [19 x i32], ptr @pos, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = load i32, ptr %9, align 4, !tbaa !5
  %107 = call noundef i32 @_Z5iRootii(i32 noundef %105, i32 noundef %106)
  %108 = sub nsw i32 %107, 1
  %109 = load i32, ptr %9, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [9 x i32], ptr @tp, i64 0, i64 %110
  store i32 %108, ptr %111, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %101
  %113 = load i32, ptr %9, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %9, align 4, !tbaa !5
  br label %93, !llvm.loop !11

115:                                              ; preds = %93
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  store i32 %117, ptr %10, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %146, %115
  %119 = load i32, ptr %10, align 4, !tbaa !5
  %120 = icmp sge i32 %119, 1
  br i1 %120, label %122, label %121

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

122:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %123 = load i32, ptr %10, align 4, !tbaa !5
  %124 = load i32, ptr %10, align 4, !tbaa !5
  %125 = add nsw i32 %123, %124
  store i32 %125, ptr %11, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %141, %122
  %127 = load i32, ptr %11, align 4, !tbaa !5
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = icmp slt i32 %127, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %126
  store i32 14, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %145

131:                                              ; preds = %126
  %132 = load i32, ptr %11, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [9 x i32], ptr @tp, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = load i32, ptr %10, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [9 x i32], ptr @tp, i64 0, i64 %137
  %139 = load i32, ptr %138, align 4, !tbaa !5
  %140 = sub nsw i32 %139, %135
  store i32 %140, ptr %138, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %131
  %142 = load i32, ptr %10, align 4, !tbaa !5
  %143 = load i32, ptr %11, align 4, !tbaa !5
  %144 = add nsw i32 %143, %142
  store i32 %144, ptr %11, align 4, !tbaa !5
  br label %126, !llvm.loop !12

145:                                              ; preds = %130
  br label %146

146:                                              ; preds = %145
  %147 = load i32, ptr %10, align 4, !tbaa !5
  %148 = add nsw i32 %147, -1
  store i32 %148, ptr %10, align 4, !tbaa !5
  br label %118, !llvm.loop !13

149:                                              ; preds = %121
  %150 = load i32, ptr getelementptr inbounds ([9 x i32], ptr @tp, i64 0, i64 1), align 4, !tbaa !5
  %151 = load i32, ptr %7, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [19 x i32], ptr @sp, i64 0, i64 %152
  store i32 %150, ptr %153, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #7
  br label %154

154:                                              ; preds = %149
  %155 = load i32, ptr %7, align 4, !tbaa !5
  %156 = add nsw i32 %155, 1
  store i32 %156, ptr %7, align 4, !tbaa !5
  br label %81, !llvm.loop !14

157:                                              ; preds = %85
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #7
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %245, %157
  %159 = load i32, ptr %12, align 4, !tbaa !5
  %160 = load i32, ptr %2, align 4, !tbaa !5
  %161 = icmp slt i32 %159, %160
  br i1 %161, label %163, label %162

162:                                              ; preds = %158
  store i32 17, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #7
  br label %248

163:                                              ; preds = %158
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #7
  %164 = load i32, ptr @tot, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds i32, ptr @pos, i64 %165
  %167 = load i32, ptr %12, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [9 x i32], ptr @low, i64 0, i64 %168
  %170 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @pos, ptr noundef %166, ptr noundef nonnull align 4 dereferenceable(4) %169)
  %171 = ptrtoint ptr %170 to i64
  %172 = sub i64 %171, ptrtoint (ptr @pos to i64)
  %173 = sdiv exact i64 %172, 4
  %174 = add nsw i64 %173, 1
  %175 = trunc i64 %174 to i32
  store i32 %175, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  %176 = load i32, ptr @tot, align 4, !tbaa !5
  %177 = sext i32 %176 to i64
  %178 = getelementptr inbounds i32, ptr @pos, i64 %177
  %179 = load i32, ptr %12, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = getelementptr inbounds [9 x i32], ptr @upp, i64 0, i64 %180
  %182 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @pos, ptr noundef %178, ptr noundef nonnull align 4 dereferenceable(4) %181)
  %183 = ptrtoint ptr %182 to i64
  %184 = sub i64 %183, ptrtoint (ptr @pos to i64)
  %185 = sdiv exact i64 %184, 4
  %186 = add nsw i64 %185, 1
  %187 = trunc i64 %186 to i32
  store i32 %187, ptr %14, align 4, !tbaa !5
  br label %188

188:                                              ; preds = %209, %163
  %189 = load i32, ptr %13, align 4, !tbaa !5
  %190 = load i32, ptr %14, align 4, !tbaa !5
  %191 = icmp slt i32 %189, %190
  br i1 %191, label %192, label %212

192:                                              ; preds = %188
  %193 = load i32, ptr %13, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [9 x i32], ptr @pL, i64 0, i64 %194
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %195, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %197 = load i32, ptr %196, align 4, !tbaa !5
  %198 = load i32, ptr %13, align 4, !tbaa !5
  %199 = sext i32 %198 to i64
  %200 = getelementptr inbounds [9 x i32], ptr @pL, i64 0, i64 %199
  store i32 %197, ptr %200, align 4, !tbaa !5
  %201 = load i32, ptr %13, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [9 x i32], ptr @pR, i64 0, i64 %202
  %204 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %203, ptr noundef nonnull align 4 dereferenceable(4) %12)
  %205 = load i32, ptr %204, align 4, !tbaa !5
  %206 = load i32, ptr %13, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [9 x i32], ptr @pR, i64 0, i64 %207
  store i32 %205, ptr %208, align 4, !tbaa !5
  br label %209

209:                                              ; preds = %192
  %210 = load i32, ptr %13, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  store i32 %211, ptr %13, align 4, !tbaa !5
  br label %188, !llvm.loop !15

212:                                              ; preds = %188
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  %213 = load i32, ptr %12, align 4, !tbaa !5
  store i32 %213, ptr %15, align 4, !tbaa !5
  br label %214

214:                                              ; preds = %241, %212
  %215 = load i32, ptr %15, align 4, !tbaa !5
  %216 = load i32, ptr %2, align 4, !tbaa !5
  %217 = icmp slt i32 %215, %216
  br i1 %217, label %219, label %218

218:                                              ; preds = %214
  store i32 23, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  br label %244

219:                                              ; preds = %214
  %220 = load i32, ptr %12, align 4, !tbaa !5
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %221
  %223 = load i32, ptr %15, align 4, !tbaa !5
  %224 = load i32, ptr %12, align 4, !tbaa !5
  %225 = sub nsw i32 %223, %224
  %226 = sext i32 %225 to i64
  %227 = getelementptr inbounds [9 x i32], ptr %222, i64 0, i64 %226
  %228 = load i32, ptr %227, align 4, !tbaa !5
  %229 = load i32, ptr %15, align 4, !tbaa !5
  %230 = sext i32 %229 to i64
  %231 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %230
  %232 = load i32, ptr %12, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [9 x i32], ptr %231, i64 0, i64 %233
  store i32 %228, ptr %234, align 4, !tbaa !5
  %235 = load i32, ptr %12, align 4, !tbaa !5
  %236 = sext i32 %235 to i64
  %237 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %236
  %238 = load i32, ptr %15, align 4, !tbaa !5
  %239 = sext i32 %238 to i64
  %240 = getelementptr inbounds [9 x i32], ptr %237, i64 0, i64 %239
  store i32 %228, ptr %240, align 4, !tbaa !5
  br label %241

241:                                              ; preds = %219
  %242 = load i32, ptr %15, align 4, !tbaa !5
  %243 = add nsw i32 %242, 1
  store i32 %243, ptr %15, align 4, !tbaa !5
  br label %214, !llvm.loop !16

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

245:                                              ; preds = %244
  %246 = load i32, ptr %12, align 4, !tbaa !5
  %247 = add nsw i32 %246, 1
  store i32 %247, ptr %12, align 4, !tbaa !5
  br label %158, !llvm.loop !17

248:                                              ; preds = %162
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 0, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 1, ptr %17, align 4, !tbaa !5
  br label %249

249:                                              ; preds = %290, %248
  %250 = load i32, ptr %17, align 4, !tbaa !5
  %251 = load i32, ptr @tot, align 4, !tbaa !5
  %252 = icmp slt i32 %250, %251
  br i1 %252, label %254, label %253

253:                                              ; preds = %249
  store i32 26, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %293

254:                                              ; preds = %249
  %255 = load i32, ptr %17, align 4, !tbaa !5
  %256 = sext i32 %255 to i64
  %257 = getelementptr inbounds [9 x i32], ptr @pL, i64 0, i64 %256
  %258 = load i32, ptr %257, align 4, !tbaa !5
  %259 = load i32, ptr %17, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [9 x i32], ptr @pR, i64 0, i64 %260
  %262 = load i32, ptr %261, align 4, !tbaa !5
  %263 = icmp sle i32 %258, %262
  br i1 %263, label %264, label %289

264:                                              ; preds = %254
  %265 = load i32, ptr %17, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %267 = getelementptr inbounds [19 x i32], ptr @sp, i64 0, i64 %266
  %268 = load i32, ptr %267, align 4, !tbaa !5
  %269 = load i32, ptr %17, align 4, !tbaa !5
  %270 = sub nsw i32 %269, 1
  %271 = sext i32 %270 to i64
  %272 = getelementptr inbounds [19 x i32], ptr @sp, i64 0, i64 %271
  %273 = load i32, ptr %272, align 4, !tbaa !5
  %274 = sub nsw i32 %268, %273
  %275 = load i32, ptr %17, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [9 x i32], ptr @pL, i64 0, i64 %276
  %278 = load i32, ptr %277, align 4, !tbaa !5
  %279 = load i32, ptr %17, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [9 x i32], ptr @pR, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !5
  %283 = load i32, ptr %5, align 4, !tbaa !5
  %284 = load i32, ptr %6, align 4, !tbaa !5
  %285 = call noundef i32 @_Z5solveiiii(i32 noundef %278, i32 noundef %282, i32 noundef %283, i32 noundef %284)
  %286 = mul nsw i32 %274, %285
  %287 = load i32, ptr %16, align 4, !tbaa !5
  %288 = add nsw i32 %287, %286
  store i32 %288, ptr %16, align 4, !tbaa !5
  br label %289

289:                                              ; preds = %264, %254
  br label %290

290:                                              ; preds = %289
  %291 = load i32, ptr %17, align 4, !tbaa !5
  %292 = add nsw i32 %291, 1
  store i32 %292, ptr %17, align 4, !tbaa !5
  br label %249, !llvm.loop !18

293:                                              ; preds = %253
  %294 = load i32, ptr %16, align 4, !tbaa !5
  %295 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i32 noundef %294)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  %296 = load i32, ptr %1, align 4
  ret i32 %296
}

declare i32 @__isoc99_scanf(ptr noundef, ...) #4

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) #5

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #6

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

attributes #0 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #1 = { 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 #2 = { 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 #3 = { 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 #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 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 #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 = !{!"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 = distinct !{!13, !10}
!14 = distinct !{!14, !10}
!15 = distinct !{!15, !10}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = distinct !{!18, !10}


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

@Gcd = external dso_local local_unnamed_addr global [9 x [9 x i32]], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@pL = external dso_local global [9 x i32], align 16
@pR = external dso_local global [9 x i32], align 16
@low = external dso_local global [9 x i32], align 16
@upp = external dso_local global [9 x i32], align 16
@pos = external dso_local global [19 x i32], align 16
@tp = external dso_local local_unnamed_addr global [9 x i32], align 16
@sp = external dso_local local_unnamed_addr global [19 x i32], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z5solveiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5iRootii(i32 noundef, i32 noundef) local_unnamed_addr #2

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %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
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #7
  %6 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %4, ptr noundef nonnull %2, ptr noundef nonnull %1, ptr noundef nonnull %3)
  %7 = load i32, ptr %1, align 4, !tbaa !5
  %8 = add nsw i32 %7, -1
  %9 = load i32, ptr %2, align 4, !tbaa !5
  %10 = add nsw i32 %8, %9
  store i32 %10, ptr %2, align 4, !tbaa !5
  %11 = load i32, ptr %3, align 4, !tbaa !5
  %12 = add nsw i32 %11, -1
  %13 = load i32, ptr %4, align 4, !tbaa !5
  %14 = add nsw i32 %12, %13
  store i32 %14, ptr %4, align 4, !tbaa !5
  %15 = load i32, ptr @tot, align 4, !tbaa !5
  %16 = add nsw i32 %15, 1
  store i32 %16, ptr @tot, align 4, !tbaa !5
  %17 = sext i32 %15 to i64
  %18 = getelementptr inbounds [19 x i32], ptr @pos, i64 0, i64 %17
  store i32 1, ptr %18, align 4, !tbaa !5
  %.not70 = icmp slt i32 %10, 2
  br i1 %.not70, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %19 = load i32, ptr %1, align 4, !tbaa !5
  %20 = add nsw i32 %19, -1
  %21 = trunc nuw nsw i64 %indvars.iv to i32
  %22 = call noundef i32 @_Z5iRootii(i32 noundef %20, i32 noundef %21)
  %23 = getelementptr inbounds [9 x i32], ptr @low, i64 0, i64 %indvars.iv
  store i32 %22, ptr %23, align 4, !tbaa !5
  %24 = load i32, ptr @tot, align 4, !tbaa !5
  %25 = add nsw i32 %24, 1
  store i32 %25, ptr @tot, align 4, !tbaa !5
  %26 = sext i32 %24 to i64
  %27 = getelementptr inbounds [19 x i32], ptr @pos, i64 0, i64 %26
  store i32 %22, ptr %27, align 4, !tbaa !5
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = call noundef i32 @_Z5iRootii(i32 noundef %28, i32 noundef %21)
  %30 = getelementptr inbounds [9 x i32], ptr @upp, i64 0, i64 %indvars.iv
  store i32 %29, ptr %30, align 4, !tbaa !5
  %31 = load i32, ptr @tot, align 4, !tbaa !5
  %32 = add nsw i32 %31, 1
  store i32 %32, ptr @tot, align 4, !tbaa !5
  %33 = sext i32 %31 to i64
  %34 = getelementptr inbounds [19 x i32], ptr @pos, i64 0, i64 %33
  store i32 %29, ptr %34, align 4, !tbaa !5
  %35 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv
  store i32 %21, ptr %35, align 4, !tbaa !5
  %36 = getelementptr inbounds [9 x i32], ptr @Gcd, i64 0, i64 %indvars.iv
  store i32 %21, ptr %36, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = shl nuw i32 2, %21
  %38 = load i32, ptr %2, align 4, !tbaa !5
  %.not = icmp sgt i32 %37, %38
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !9

._crit_edge.loopexit:                             ; preds = %.lr.ph
  %39 = trunc nuw i64 %indvars.iv.next to i32
  br label %._crit_edge

._crit_edge:                                      ; preds = %._crit_edge.loopexit, %0
  %40 = phi i32 [ %16, %0 ], [ %32, %._crit_edge.loopexit ]
  %.063.lcssa = phi i32 [ 1, %0 ], [ %39, %._crit_edge.loopexit ]
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr @pos, i64 %41
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @pos, ptr noundef nonnull %42)
  %43 = load i32, ptr @tot, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds i32, ptr @pos, i64 %44
  %46 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @pos, ptr noundef nonnull %45)
  %47 = ptrtoint ptr %46 to i64
  %48 = sub i64 %47, ptrtoint (ptr @pos to i64)
  %49 = lshr exact i64 %48, 2
  %50 = trunc i64 %49 to i32
  store i32 %50, ptr @tot, align 4, !tbaa !5
  %51 = icmp sgt i32 %50, 1
  br i1 %51, label %.lr.ph86, label %._crit_edge87

._crit_edge87:                                    ; preds = %._crit_edge83, %._crit_edge
  %52 = phi i32 [ %50, %._crit_edge ], [ %75, %._crit_edge83 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #7
  store i32 1, ptr %5, align 4, !tbaa !5
  %53 = icmp sgt i32 %.063.lcssa, 1
  br i1 %53, label %.lr.ph99.preheader, label %._crit_edge100

.lr.ph99.preheader:                               ; preds = %._crit_edge87
  %wide.trip.count = zext nneg i32 %.063.lcssa to i64
  %54 = add nsw i64 %wide.trip.count, -1
  br label %.lr.ph99

.lr.ph86:                                         ; preds = %._crit_edge, %._crit_edge83
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %._crit_edge83 ], [ 1, %._crit_edge ]
  %55 = getelementptr inbounds [9 x i32], ptr @pL, i64 0, i64 %indvars.iv122
  store i32 9, ptr %55, align 4, !tbaa !5
  %56 = getelementptr inbounds [9 x i32], ptr @pR, i64 0, i64 %indvars.iv122
  store i32 0, ptr %56, align 4, !tbaa !5
  %57 = getelementptr inbounds [19 x i32], ptr @pos, i64 0, i64 %indvars.iv122
  %58 = load i32, ptr %57, align 4, !tbaa !5
  %.not6972 = icmp slt i32 %58, 2
  br i1 %.not6972, label %._crit_edge83, label %.lr.ph75

.preheader:                                       ; preds = %.lr.ph75
  %59 = trunc nuw i64 %indvars.iv.next110 to i32
  %60 = icmp sgt i32 %59, 1
  br i1 %60, label %.lr.ph82.preheader, label %._crit_edge83

.lr.ph82.preheader:                               ; preds = %.preheader
  %61 = shl nuw i32 %59, 1
  %62 = and i64 %indvars.iv109, 4294967295
  %63 = and i64 %indvars.iv.next110, 2147483647
  %64 = and i64 %indvars.iv.next110, 2147483647
  br label %.lr.ph82

.lr.ph75:                                         ; preds = %.lr.ph86, %.lr.ph75
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %.lr.ph75 ], [ 1, %.lr.ph86 ]
  %65 = phi i32 [ %71, %.lr.ph75 ], [ %58, %.lr.ph86 ]
  %66 = trunc nuw nsw i64 %indvars.iv109 to i32
  %67 = call noundef i32 @_Z5iRootii(i32 noundef %65, i32 noundef %66)
  %68 = add nsw i32 %67, -1
  %69 = getelementptr inbounds [9 x i32], ptr @tp, i64 0, i64 %indvars.iv109
  store i32 %68, ptr %69, align 4, !tbaa !5
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %70 = shl nuw i32 2, %66
  %71 = load i32, ptr %57, align 4, !tbaa !5
  %.not69 = icmp sgt i32 %70, %71
  br i1 %.not69, label %.preheader, label %.lr.ph75, !llvm.loop !11

.loopexit:                                        ; preds = %82, %.lr.ph82
  %72 = icmp sgt i64 %indvars.iv119, 2
  %indvars.iv.next115 = add nsw i64 %indvars.iv114, -1
  br i1 %72, label %.lr.ph82, label %._crit_edge83, !llvm.loop !12

._crit_edge83:                                    ; preds = %.loopexit, %.lr.ph86, %.preheader
  %73 = load i32, ptr getelementptr inbounds (i8, ptr @tp, i64 4), align 4, !tbaa !5
  %74 = getelementptr inbounds [19 x i32], ptr @sp, i64 0, i64 %indvars.iv122
  store i32 %73, ptr %74, align 4, !tbaa !5
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %75 = load i32, ptr @tot, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = icmp slt i64 %indvars.iv.next123, %76
  br i1 %77, label %.lr.ph86, label %._crit_edge87, !llvm.loop !13

.lr.ph82:                                         ; preds = %.lr.ph82.preheader, %.loopexit
  %indvars.iv119 = phi i64 [ %63, %.lr.ph82.preheader ], [ %indvars.iv.next120, %.loopexit ]
  %indvars.iv114 = phi i64 [ %62, %.lr.ph82.preheader ], [ %indvars.iv.next115, %.loopexit ]
  %indvars.iv112.in = phi i32 [ %61, %.lr.ph82.preheader ], [ %indvars.iv112, %.loopexit ]
  %indvars.iv112 = add i32 %indvars.iv112.in, -2
  %indvars.iv.next120 = add nsw i64 %indvars.iv119, -1
  %78 = shl nuw nsw i64 %indvars.iv.next120, 1
  %79 = icmp ult i64 %78, %64
  br i1 %79, label %.lr.ph79, label %.loopexit

.lr.ph79:                                         ; preds = %.lr.ph82
  %80 = zext i32 %indvars.iv112 to i64
  %81 = getelementptr inbounds [9 x i32], ptr @tp, i64 0, i64 %indvars.iv.next120
  %.promoted = load i32, ptr %81, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %.lr.ph79, %82
  %indvars.iv116 = phi i64 [ %80, %.lr.ph79 ], [ %indvars.iv.next117, %82 ]
  %83 = phi i32 [ %.promoted, %.lr.ph79 ], [ %86, %82 ]
  %84 = getelementptr inbounds [9 x i32], ptr @tp, i64 0, i64 %indvars.iv116
  %85 = load i32, ptr %84, align 4, !tbaa !5
  %86 = sub nsw i32 %83, %85
  store i32 %86, ptr %81, align 4, !tbaa !5
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, %indvars.iv114
  %87 = trunc nuw i64 %indvars.iv.next117 to i32
  %88 = icmp sgt i32 %59, %87
  br i1 %88, label %82, label %.loopexit, !llvm.loop !14

._crit_edge100.loopexit:                          ; preds = %._crit_edge96
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge100

._crit_edge100:                                   ; preds = %._crit_edge100.loopexit, %._crit_edge87
  %89 = phi i32 [ %.pre, %._crit_edge100.loopexit ], [ %52, %._crit_edge87 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %90 = icmp sgt i32 %89, 1
  br i1 %90, label %.lr.ph104, label %._crit_edge105

.lr.ph99:                                         ; preds = %.lr.ph99.preheader, %._crit_edge96
  %storemerge97 = phi i32 [ %129, %._crit_edge96 ], [ 1, %.lr.ph99.preheader ]
  %91 = load i32, ptr @tot, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds i32, ptr @pos, i64 %92
  %94 = sext i32 %storemerge97 to i64
  %95 = getelementptr inbounds [9 x i32], ptr @low, i64 0, i64 %94
  %96 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @pos, ptr noundef nonnull %93, ptr noundef nonnull align 4 dereferenceable(4) %95)
  %97 = ptrtoint ptr %96 to i64
  %98 = sub i64 %97, ptrtoint (ptr @pos to i64)
  %99 = lshr exact i64 %98, 2
  %100 = trunc i64 %99 to i32
  %101 = load i32, ptr @tot, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr @pos, i64 %102
  %104 = load i32, ptr %5, align 4, !tbaa !5
  %105 = sext i32 %104 to i64
  %106 = getelementptr inbounds [9 x i32], ptr @upp, i64 0, i64 %105
  %107 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @pos, ptr noundef nonnull %103, ptr noundef nonnull align 4 dereferenceable(4) %106)
  %108 = ptrtoint ptr %107 to i64
  %109 = sub i64 %108, ptrtoint (ptr @pos to i64)
  %110 = lshr exact i64 %109, 2
  %111 = trunc i64 %110 to i32
  %112 = add i32 %111, 1
  %.05888 = add i32 %100, 1
  %113 = icmp slt i32 %.05888, %112
  br i1 %113, label %.lr.ph91.preheader, label %._crit_edge92

.lr.ph91.preheader:                               ; preds = %.lr.ph99
  %114 = sext i32 %.05888 to i64
  br label %.lr.ph91

.lr.ph91:                                         ; preds = %.lr.ph91.preheader, %.lr.ph91
  %indvars.iv125 = phi i64 [ %114, %.lr.ph91.preheader ], [ %indvars.iv.next126, %.lr.ph91 ]
  %115 = getelementptr inbounds [9 x i32], ptr @pL, i64 0, i64 %indvars.iv125
  %116 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %115, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %117 = load i32, ptr %116, align 4, !tbaa !5
  store i32 %117, ptr %115, align 4, !tbaa !5
  %118 = getelementptr inbounds [9 x i32], ptr @pR, i64 0, i64 %indvars.iv125
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %118, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %120 = load i32, ptr %119, align 4, !tbaa !5
  store i32 %120, ptr %118, align 4, !tbaa !5
  %indvars.iv.next126 = add nsw i64 %indvars.iv125, 1
  %lftr.wideiv = trunc i64 %indvars.iv.next126 to i32
  %exitcond.not = icmp eq i32 %112, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge92, label %.lr.ph91, !llvm.loop !15

._crit_edge92:                                    ; preds = %.lr.ph91, %.lr.ph99
  %121 = load i32, ptr %5, align 4, !tbaa !5
  %122 = icmp slt i32 %121, %.063.lcssa
  br i1 %122, label %.lr.ph95, label %._crit_edge96

.lr.ph95:                                         ; preds = %._crit_edge92
  %123 = sext i32 %121 to i64
  %124 = sub nsw i64 %wide.trip.count, %123
  %xtraiter = and i64 %124, 1
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.prol.loopexit, label %.prol.loopexit.unr-lcssa

.prol.loopexit.unr-lcssa:                         ; preds = %.lr.ph95
  %125 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %123, i64 0
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %123, i64 %123
  store i32 %126, ptr %127, align 4, !tbaa !5
  %indvars.iv.next129.prol = add nsw i64 %123, 1
  br label %.prol.loopexit

.prol.loopexit:                                   ; preds = %.prol.loopexit.unr-lcssa, %.lr.ph95
  %indvars.iv128.unr = phi i64 [ %123, %.lr.ph95 ], [ %indvars.iv.next129.prol, %.prol.loopexit.unr-lcssa ]
  %128 = icmp eq i64 %54, %123
  br i1 %128, label %._crit_edge96, label %.lr.ph95.new

._crit_edge96:                                    ; preds = %.prol.loopexit, %.lr.ph95.new, %._crit_edge92
  %129 = add nsw i32 %121, 1
  store i32 %129, ptr %5, align 4, !tbaa !5
  %130 = icmp slt i32 %129, %.063.lcssa
  br i1 %130, label %.lr.ph99, label %._crit_edge100.loopexit, !llvm.loop !16

.lr.ph95.new:                                     ; preds = %.prol.loopexit, %.lr.ph95.new
  %indvars.iv128 = phi i64 [ %indvars.iv.next129.1, %.lr.ph95.new ], [ %indvars.iv128.unr, %.prol.loopexit ]
  %131 = sub nsw i64 %indvars.iv128, %123
  %132 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %123, i64 %131
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv128, i64 %123
  store i32 %133, ptr %134, align 4, !tbaa !5
  %135 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %123, i64 %indvars.iv128
  store i32 %133, ptr %135, align 4, !tbaa !5
  %indvars.iv.next129 = add nsw i64 %indvars.iv128, 1
  %136 = sub nsw i64 %indvars.iv.next129, %123
  %137 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %123, i64 %136
  %138 = load i32, ptr %137, align 4, !tbaa !5
  %139 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv.next129, i64 %123
  store i32 %138, ptr %139, align 4, !tbaa !5
  %140 = getelementptr inbounds [9 x [9 x i32]], ptr @Gcd, i64 0, i64 %123, i64 %indvars.iv.next129
  store i32 %138, ptr %140, align 4, !tbaa !5
  %indvars.iv.next129.1 = add nsw i64 %indvars.iv128, 2
  %exitcond131.not.1 = icmp eq i64 %indvars.iv.next129.1, %wide.trip.count
  br i1 %exitcond131.not.1, label %._crit_edge96, label %.lr.ph95.new, !llvm.loop !17

._crit_edge105:                                   ; preds = %159, %._crit_edge100
  %.056.lcssa = phi i32 [ 0, %._crit_edge100 ], [ %.1, %159 ]
  %141 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i32 noundef %.056.lcssa)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  ret i32 0

.lr.ph104:                                        ; preds = %._crit_edge100, %159
  %142 = phi i32 [ %160, %159 ], [ %89, %._crit_edge100 ]
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %159 ], [ 1, %._crit_edge100 ]
  %.056101 = phi i32 [ %.1, %159 ], [ 0, %._crit_edge100 ]
  %143 = getelementptr inbounds [9 x i32], ptr @pL, i64 0, i64 %indvars.iv132
  %144 = load i32, ptr %143, align 4, !tbaa !5
  %145 = getelementptr inbounds [9 x i32], ptr @pR, i64 0, i64 %indvars.iv132
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %.not68 = icmp sgt i32 %144, %146
  br i1 %.not68, label %159, label %147

147:                                              ; preds = %.lr.ph104
  %148 = getelementptr inbounds [19 x i32], ptr @sp, i64 0, i64 %indvars.iv132
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = add nsw i64 %indvars.iv132, -1
  %151 = getelementptr inbounds [19 x i32], ptr @sp, i64 0, i64 %150
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sub nsw i32 %149, %152
  %154 = load i32, ptr %3, align 4, !tbaa !5
  %155 = load i32, ptr %4, align 4, !tbaa !5
  %156 = call noundef i32 @_Z5solveiiii(i32 noundef %144, i32 noundef %146, i32 noundef %154, i32 noundef %155)
  %157 = mul nsw i32 %156, %153
  %158 = add nsw i32 %157, %.056101
  %.pre135 = load i32, ptr @tot, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %.lr.ph104, %147
  %160 = phi i32 [ %.pre135, %147 ], [ %142, %.lr.ph104 ]
  %.1 = phi i32 [ %158, %147 ], [ %.056101, %.lr.ph104 ]
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %161 = sext i32 %160 to i64
  %162 = icmp slt i64 %indvars.iv.next133, %161
  br i1 %162, label %.lr.ph104, label %._crit_edge105, !llvm.loop !18
}

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef, ptr noundef) local_unnamed_addr #5

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #6

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

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


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