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

; 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 [21 x [21 x i32]], align 16
@tot = external dso_local global i32, align 4
@pL = external dso_local global [21 x i32], align 16
@pR = external dso_local global [21 x i32], align 16
@low = external dso_local global [21 x i32], align 16
@upp = external dso_local global [21 x i32], align 16
@pos = external dso_local global [43 x i32], align 16
@tp = external dso_local global [21 x i32], align 16
@sp = external dso_local global [43 x i32], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 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 i64 @_Z5solveiixx(i32 noundef, i32 noundef, i64 noundef, i64 noundef) #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5iRootxi(i64 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 i64, align 8
  %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 [43 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 = %68, %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 %71

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

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

71:                                               ; preds = %31
  %72 = load i32, ptr @tot, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds i32, ptr @pos, i64 %73
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @pos, ptr noundef %74)
  %75 = load i32, ptr @tot, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds i32, ptr @pos, i64 %76
  %78 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @pos, ptr noundef %77)
  %79 = ptrtoint ptr %78 to i64
  %80 = sub i64 %79, ptrtoint (ptr @pos to i64)
  %81 = sdiv exact i64 %80, 4
  %82 = trunc i64 %81 to i32
  store i32 %82, 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 %83

83:                                               ; preds = %157, %71
  %84 = load i32, ptr %7, align 4, !tbaa !5
  %85 = load i32, ptr @tot, align 4, !tbaa !5
  %86 = icmp slt i32 %84, %85
  br i1 %86, label %88, label %87

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

88:                                               ; preds = %83
  %89 = load i32, ptr %7, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [21 x i32], ptr @pL, i64 0, i64 %90
  store i32 21, ptr %91, align 4, !tbaa !5
  %92 = load i32, ptr %7, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [21 x i32], ptr @pR, i64 0, i64 %93
  store i32 0, ptr %94, 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 %95

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

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

115:                                              ; preds = %103
  %116 = load i32, ptr %9, align 4, !tbaa !5
  %117 = add nsw i32 %116, 1
  store i32 %117, ptr %9, align 4, !tbaa !5
  br label %95, !llvm.loop !11

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

121:                                              ; preds = %149, %118
  %122 = load i32, ptr %10, align 4, !tbaa !5
  %123 = icmp sge i32 %122, 1
  br i1 %123, label %125, label %124

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

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

129:                                              ; preds = %144, %125
  %130 = load i32, ptr %11, align 4, !tbaa !5
  %131 = load i32, ptr %9, align 4, !tbaa !5
  %132 = icmp slt i32 %130, %131
  br i1 %132, label %134, label %133

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

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

144:                                              ; preds = %134
  %145 = load i32, ptr %10, align 4, !tbaa !5
  %146 = load i32, ptr %11, align 4, !tbaa !5
  %147 = add nsw i32 %146, %145
  store i32 %147, ptr %11, align 4, !tbaa !5
  br label %129, !llvm.loop !12

148:                                              ; preds = %133
  br label %149

149:                                              ; preds = %148
  %150 = load i32, ptr %10, align 4, !tbaa !5
  %151 = add nsw i32 %150, -1
  store i32 %151, ptr %10, align 4, !tbaa !5
  br label %121, !llvm.loop !13

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

157:                                              ; preds = %152
  %158 = load i32, ptr %7, align 4, !tbaa !5
  %159 = add nsw i32 %158, 1
  store i32 %159, ptr %7, align 4, !tbaa !5
  br label %83, !llvm.loop !14

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

161:                                              ; preds = %248, %160
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = load i32, ptr %2, align 4, !tbaa !5
  %164 = icmp slt i32 %162, %163
  br i1 %164, label %166, label %165

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

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

191:                                              ; preds = %212, %166
  %192 = load i32, ptr %13, align 4, !tbaa !5
  %193 = load i32, ptr %14, align 4, !tbaa !5
  %194 = icmp slt i32 %192, %193
  br i1 %194, label %195, label %215

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

212:                                              ; preds = %195
  %213 = load i32, ptr %13, align 4, !tbaa !5
  %214 = add nsw i32 %213, 1
  store i32 %214, ptr %13, align 4, !tbaa !5
  br label %191, !llvm.loop !15

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

217:                                              ; preds = %244, %215
  %218 = load i32, ptr %15, align 4, !tbaa !5
  %219 = load i32, ptr %2, align 4, !tbaa !5
  %220 = icmp slt i32 %218, %219
  br i1 %220, label %222, label %221

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

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

244:                                              ; preds = %222
  %245 = load i32, ptr %15, align 4, !tbaa !5
  %246 = add nsw i32 %245, 1
  store i32 %246, ptr %15, align 4, !tbaa !5
  br label %217, !llvm.loop !16

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

248:                                              ; preds = %247
  %249 = load i32, ptr %12, align 4, !tbaa !5
  %250 = add nsw i32 %249, 1
  store i32 %250, ptr %12, align 4, !tbaa !5
  br label %161, !llvm.loop !17

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

252:                                              ; preds = %296, %251
  %253 = load i32, ptr %17, align 4, !tbaa !5
  %254 = load i32, ptr @tot, align 4, !tbaa !5
  %255 = icmp slt i32 %253, %254
  br i1 %255, label %257, label %256

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

257:                                              ; preds = %252
  %258 = load i32, ptr %17, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [21 x i32], ptr @pL, i64 0, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !5
  %262 = load i32, ptr %17, align 4, !tbaa !5
  %263 = sext i32 %262 to i64
  %264 = getelementptr inbounds [21 x i32], ptr @pR, i64 0, i64 %263
  %265 = load i32, ptr %264, align 4, !tbaa !5
  %266 = icmp sle i32 %261, %265
  br i1 %266, label %267, label %295

267:                                              ; preds = %257
  %268 = load i32, ptr %17, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [43 x i32], ptr @sp, i64 0, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !5
  %272 = load i32, ptr %17, align 4, !tbaa !5
  %273 = sub nsw i32 %272, 1
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [43 x i32], ptr @sp, i64 0, i64 %274
  %276 = load i32, ptr %275, align 4, !tbaa !5
  %277 = sub nsw i32 %271, %276
  %278 = sext i32 %277 to i64
  %279 = load i32, ptr %17, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [21 x i32], ptr @pL, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !5
  %283 = load i32, ptr %17, align 4, !tbaa !5
  %284 = sext i32 %283 to i64
  %285 = getelementptr inbounds [21 x i32], ptr @pR, i64 0, i64 %284
  %286 = load i32, ptr %285, align 4, !tbaa !5
  %287 = load i32, ptr %5, align 4, !tbaa !5
  %288 = sext i32 %287 to i64
  %289 = load i32, ptr %6, align 4, !tbaa !5
  %290 = sext i32 %289 to i64
  %291 = call noundef i64 @_Z5solveiixx(i32 noundef %282, i32 noundef %286, i64 noundef %288, i64 noundef %290)
  %292 = mul nsw i64 %278, %291
  %293 = load i64, ptr %16, align 8, !tbaa !18
  %294 = add nsw i64 %293, %292
  store i64 %294, ptr %16, align 8, !tbaa !18
  br label %295

295:                                              ; preds = %267, %257
  br label %296

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

299:                                              ; preds = %256
  %300 = load i64, ptr %16, align 8, !tbaa !18
  %301 = call i32 (ptr, ...) @printf(ptr noundef @.str.1, i64 noundef %300)
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 8, 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
  %302 = load i32, ptr %1, align 4
  ret i32 %302
}

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 = !{!19, !19, i64 0}
!19 = !{!"long long", !7, i64 0}
!20 = distinct !{!20, !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 [21 x [21 x i32]], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@pL = external dso_local global [21 x i32], align 16
@pR = external dso_local global [21 x i32], align 16
@low = external dso_local global [21 x i32], align 16
@upp = external dso_local global [21 x i32], align 16
@pos = external dso_local global [43 x i32], align 16
@tp = external dso_local local_unnamed_addr global [21 x i32], align 16
@sp = external dso_local local_unnamed_addr global [43 x i32], align 16
@.str = external hidden unnamed_addr constant [9 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [6 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 i64 @_Z5solveiixx(i32 noundef, i32 noundef, i64 noundef, i64 noundef) local_unnamed_addr #1

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z5iRootxi(i64 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 [43 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 = sext i32 %20 to i64
  %22 = trunc nuw nsw i64 %indvars.iv to i32
  %23 = call noundef i32 @_Z5iRootxi(i64 noundef %21, i32 noundef %22)
  %24 = getelementptr inbounds [21 x i32], ptr @low, i64 0, i64 %indvars.iv
  store i32 %23, ptr %24, align 4, !tbaa !5
  %25 = load i32, ptr @tot, align 4, !tbaa !5
  %26 = add nsw i32 %25, 1
  store i32 %26, ptr @tot, align 4, !tbaa !5
  %27 = sext i32 %25 to i64
  %28 = getelementptr inbounds [43 x i32], ptr @pos, i64 0, i64 %27
  store i32 %23, ptr %28, align 4, !tbaa !5
  %29 = load i32, ptr %2, align 4, !tbaa !5
  %30 = sext i32 %29 to i64
  %31 = call noundef i32 @_Z5iRootxi(i64 noundef %30, i32 noundef %22)
  %32 = getelementptr inbounds [21 x i32], ptr @upp, i64 0, i64 %indvars.iv
  store i32 %31, ptr %32, align 4, !tbaa !5
  %33 = load i32, ptr @tot, align 4, !tbaa !5
  %34 = add nsw i32 %33, 1
  store i32 %34, ptr @tot, align 4, !tbaa !5
  %35 = sext i32 %33 to i64
  %36 = getelementptr inbounds [43 x i32], ptr @pos, i64 0, i64 %35
  store i32 %31, ptr %36, align 4, !tbaa !5
  %37 = getelementptr inbounds [21 x [21 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv
  store i32 %22, ptr %37, align 4, !tbaa !5
  %38 = getelementptr inbounds [21 x i32], ptr @Gcd, i64 0, i64 %indvars.iv
  store i32 %22, ptr %38, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %39 = shl nuw i32 2, %22
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %.not = icmp sgt i32 %39, %40
  br i1 %.not, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !9

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

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

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

.lr.ph99.preheader:                               ; preds = %._crit_edge87
  %wide.trip.count = zext nneg i32 %.063.lcssa to i64
  %56 = 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 ]
  %57 = getelementptr inbounds [21 x i32], ptr @pL, i64 0, i64 %indvars.iv122
  store i32 21, ptr %57, align 4, !tbaa !5
  %58 = getelementptr inbounds [21 x i32], ptr @pR, i64 0, i64 %indvars.iv122
  store i32 0, ptr %58, align 4, !tbaa !5
  %59 = getelementptr inbounds [43 x i32], ptr @pos, i64 0, i64 %indvars.iv122
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %.not6972 = icmp slt i32 %60, 2
  br i1 %.not6972, label %._crit_edge83, label %.lr.ph75

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

.lr.ph82.preheader:                               ; preds = %.preheader
  %63 = shl nuw i32 %61, 1
  %64 = and i64 %indvars.iv109, 4294967295
  %65 = and i64 %indvars.iv.next110, 2147483647
  %66 = 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 ]
  %67 = phi i32 [ %74, %.lr.ph75 ], [ %60, %.lr.ph86 ]
  %68 = sext i32 %67 to i64
  %69 = trunc nuw nsw i64 %indvars.iv109 to i32
  %70 = call noundef i32 @_Z5iRootxi(i64 noundef %68, i32 noundef %69)
  %71 = add nsw i32 %70, -1
  %72 = getelementptr inbounds [21 x i32], ptr @tp, i64 0, i64 %indvars.iv109
  store i32 %71, ptr %72, align 4, !tbaa !5
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %73 = shl nuw i32 2, %69
  %74 = load i32, ptr %59, align 4, !tbaa !5
  %.not69 = icmp sgt i32 %73, %74
  br i1 %.not69, label %.preheader, label %.lr.ph75, !llvm.loop !11

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

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

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

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

85:                                               ; preds = %.lr.ph79, %85
  %indvars.iv116 = phi i64 [ %83, %.lr.ph79 ], [ %indvars.iv.next117, %85 ]
  %86 = phi i32 [ %.promoted, %.lr.ph79 ], [ %89, %85 ]
  %87 = getelementptr inbounds [21 x i32], ptr @tp, i64 0, i64 %indvars.iv116
  %88 = load i32, ptr %87, align 4, !tbaa !5
  %89 = sub nsw i32 %86, %88
  store i32 %89, ptr %84, align 4, !tbaa !5
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, %indvars.iv114
  %90 = trunc nuw i64 %indvars.iv.next117 to i32
  %91 = icmp sgt i32 %61, %90
  br i1 %91, label %85, 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
  %92 = phi i32 [ %.pre, %._crit_edge100.loopexit ], [ %54, %._crit_edge87 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #7
  %93 = icmp sgt i32 %92, 1
  br i1 %93, label %.lr.ph104, label %._crit_edge105

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

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

.lr.ph91:                                         ; preds = %.lr.ph91.preheader, %.lr.ph91
  %indvars.iv125 = phi i64 [ %117, %.lr.ph91.preheader ], [ %indvars.iv.next126, %.lr.ph91 ]
  %118 = getelementptr inbounds [21 x i32], ptr @pL, i64 0, i64 %indvars.iv125
  %119 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_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
  %121 = getelementptr inbounds [21 x i32], ptr @pR, i64 0, i64 %indvars.iv125
  %122 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %121, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %123 = load i32, ptr %122, align 4, !tbaa !5
  store i32 %123, ptr %121, 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 %115, %lftr.wideiv
  br i1 %exitcond.not, label %._crit_edge92, label %.lr.ph91, !llvm.loop !15

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

.lr.ph95:                                         ; preds = %._crit_edge92
  %126 = sext i32 %124 to i64
  %127 = sub nsw i64 %wide.trip.count, %126
  %xtraiter = and i64 %127, 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
  %128 = getelementptr inbounds [21 x [21 x i32]], ptr @Gcd, i64 0, i64 %126, i64 0
  %129 = load i32, ptr %128, align 4, !tbaa !5
  %130 = getelementptr inbounds [21 x [21 x i32]], ptr @Gcd, i64 0, i64 %126, i64 %126
  store i32 %129, ptr %130, align 4, !tbaa !5
  %indvars.iv.next129.prol = add nsw i64 %126, 1
  br label %.prol.loopexit

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

._crit_edge96:                                    ; preds = %.prol.loopexit, %.lr.ph95.new, %._crit_edge92
  %132 = add nsw i32 %124, 1
  store i32 %132, ptr %5, align 4, !tbaa !5
  %133 = icmp slt i32 %132, %.063.lcssa
  br i1 %133, 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 ]
  %134 = sub nsw i64 %indvars.iv128, %126
  %135 = getelementptr inbounds [21 x [21 x i32]], ptr @Gcd, i64 0, i64 %126, i64 %134
  %136 = load i32, ptr %135, align 4, !tbaa !5
  %137 = getelementptr inbounds [21 x [21 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv128, i64 %126
  store i32 %136, ptr %137, align 4, !tbaa !5
  %138 = getelementptr inbounds [21 x [21 x i32]], ptr @Gcd, i64 0, i64 %126, i64 %indvars.iv128
  store i32 %136, ptr %138, align 4, !tbaa !5
  %indvars.iv.next129 = add nsw i64 %indvars.iv128, 1
  %139 = sub nsw i64 %indvars.iv.next129, %126
  %140 = getelementptr inbounds [21 x [21 x i32]], ptr @Gcd, i64 0, i64 %126, i64 %139
  %141 = load i32, ptr %140, align 4, !tbaa !5
  %142 = getelementptr inbounds [21 x [21 x i32]], ptr @Gcd, i64 0, i64 %indvars.iv.next129, i64 %126
  store i32 %141, ptr %142, align 4, !tbaa !5
  %143 = getelementptr inbounds [21 x [21 x i32]], ptr @Gcd, i64 0, i64 %126, i64 %indvars.iv.next129
  store i32 %141, ptr %143, 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 = %165, %._crit_edge100
  %.056.lcssa = phi i64 [ 0, %._crit_edge100 ], [ %.1, %165 ]
  %144 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.1, i64 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, %165
  %145 = phi i32 [ %166, %165 ], [ %92, %._crit_edge100 ]
  %indvars.iv132 = phi i64 [ %indvars.iv.next133, %165 ], [ 1, %._crit_edge100 ]
  %.056101 = phi i64 [ %.1, %165 ], [ 0, %._crit_edge100 ]
  %146 = getelementptr inbounds [21 x i32], ptr @pL, i64 0, i64 %indvars.iv132
  %147 = load i32, ptr %146, align 4, !tbaa !5
  %148 = getelementptr inbounds [21 x i32], ptr @pR, i64 0, i64 %indvars.iv132
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %.not68 = icmp sgt i32 %147, %149
  br i1 %.not68, label %165, label %150

150:                                              ; preds = %.lr.ph104
  %151 = getelementptr inbounds [43 x i32], ptr @sp, i64 0, i64 %indvars.iv132
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = add nsw i64 %indvars.iv132, -1
  %154 = getelementptr inbounds [43 x i32], ptr @sp, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = sub nsw i32 %152, %155
  %157 = sext i32 %156 to i64
  %158 = load i32, ptr %3, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = load i32, ptr %4, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = call noundef i64 @_Z5solveiixx(i32 noundef %147, i32 noundef %149, i64 noundef %159, i64 noundef %161)
  %163 = mul nsw i64 %162, %157
  %164 = add nsw i64 %163, %.056101
  %.pre135 = load i32, ptr @tot, align 4, !tbaa !5
  br label %165

165:                                              ; preds = %.lr.ph104, %150
  %166 = phi i32 [ %.pre135, %150 ], [ %145, %.lr.ph104 ]
  %.1 = phi i64 [ %164, %150 ], [ %.056101, %.lr.ph104 ]
  %indvars.iv.next133 = add nuw nsw i64 %indvars.iv132, 1
  %167 = sext i32 %166 to i64
  %168 = icmp slt i64 %indvars.iv.next133, %167
  br i1 %168, 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