; LLVM IR from tangjz/acm-icpc :: self_training/2015-05-01 (K)

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tsize = external dso_local global i32, align 4
@s = external dso_local global [50010 x i32], align 16
@pos = external dso_local global [50010 x i32], align 16
@pre = external dso_local global [50010 x i32], align 16
@suf = external dso_local global [50010 x i32], align 16
@tot = external dso_local global i32, align 4
@que = external dso_local global [50010 x i32], align 16
@L = external dso_local global [50010 x i32], align 16
@R = external dso_local global [50010 x i32], align 16
@D = external dso_local global [50010 x i32], align 16
@idn = external dso_local global [50010 x i32], align 16
@idx = external dso_local global [50010 x i32], align 16
@ans = external dso_local global [50010 x i32], align 16
@seg = external dso_local global [100020 x i32], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4)) #0

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildii(i32 noundef, i32 noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateiii(i32 noundef, i32 noundef, i32 noundef) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #4 {
  %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 ptr, align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  %14 = load i32, ptr @n, align 4, !tbaa !5
  %15 = sitofp i32 %14 to double
  %16 = fadd double %15, 2.330000e-01
  %17 = call double @sqrt(double noundef %16) #9
  %18 = fptosi double %17 to i32
  store i32 %18, ptr @tsize, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #9
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %19

19:                                               ; preds = %38, %0
  %20 = load i32, ptr %2, align 4, !tbaa !5
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %22 = icmp sle i32 %20, %21
  br i1 %22, label %24, label %23

23:                                               ; preds = %19
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #9
  br label %41

24:                                               ; preds = %19
  %25 = load i32, ptr %2, align 4, !tbaa !5
  %26 = sext i32 %25 to i64
  %27 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %26
  call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) %27)
  %28 = load i32, ptr %2, align 4, !tbaa !5
  %29 = sub nsw i32 %28, 1
  %30 = sext i32 %29 to i64
  %31 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %30
  %32 = load i32, ptr %31, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = add nsw i32 %36, %32
  store i32 %37, ptr %35, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %24
  %39 = load i32, ptr %2, align 4, !tbaa !5
  %40 = add nsw i32 %39, 1
  store i32 %40, ptr %2, align 4, !tbaa !5
  br label %19, !llvm.loop !9

41:                                               ; preds = %23
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #9
  store i32 0, ptr %3, align 4, !tbaa !5
  br label %42

42:                                               ; preds = %56, %41
  %43 = load i32, ptr %3, align 4, !tbaa !5
  %44 = load i32, ptr @n, align 4, !tbaa !5
  %45 = icmp sle i32 %43, %44
  br i1 %45, label %47, label %46

46:                                               ; preds = %42
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #9
  br label %59

47:                                               ; preds = %42
  %48 = load i32, ptr %3, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %49
  %51 = load i32, ptr %50, align 4, !tbaa !5
  %52 = load i32, ptr @tot, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr @tot, align 4, !tbaa !5
  %54 = sext i32 %52 to i64
  %55 = getelementptr inbounds [50010 x i32], ptr @que, i64 0, i64 %54
  store i32 %51, ptr %55, align 4, !tbaa !5
  br label %56

56:                                               ; preds = %47
  %57 = load i32, ptr %3, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr %3, align 4, !tbaa !5
  br label %42, !llvm.loop !11

59:                                               ; preds = %46
  %60 = load i32, ptr @tot, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds i32, ptr @que, i64 %61
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %62)
  %63 = load i32, ptr @tot, align 4, !tbaa !5
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds i32, ptr @que, i64 %64
  %66 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %65)
  %67 = ptrtoint ptr %66 to i64
  %68 = sub i64 %67, ptrtoint (ptr @que to i64)
  %69 = sdiv exact i64 %68, 4
  %70 = trunc i64 %69 to i32
  store i32 %70, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #9
  store i32 0, ptr %4, align 4, !tbaa !5
  br label %71

71:                                               ; preds = %92, %59
  %72 = load i32, ptr %4, align 4, !tbaa !5
  %73 = load i32, ptr @n, align 4, !tbaa !5
  %74 = icmp sle i32 %72, %73
  br i1 %74, label %76, label %75

75:                                               ; preds = %71
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #9
  br label %95

76:                                               ; preds = %71
  %77 = load i32, ptr @tot, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr @que, i64 %78
  %80 = load i32, ptr %4, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %82 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %81
  %83 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %79, ptr noundef nonnull align 4 dereferenceable(4) %82)
  %84 = ptrtoint ptr %83 to i64
  %85 = sub i64 %84, ptrtoint (ptr @que to i64)
  %86 = sdiv exact i64 %85, 4
  %87 = add nsw i64 %86, 1
  %88 = trunc i64 %87 to i32
  %89 = load i32, ptr %4, align 4, !tbaa !5
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %90
  store i32 %88, ptr %91, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %76
  %93 = load i32, ptr %4, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %4, align 4, !tbaa !5
  br label %71, !llvm.loop !12

95:                                               ; preds = %75
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 200040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #9
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %96

96:                                               ; preds = %133, %95
  %97 = load i32, ptr %5, align 4, !tbaa !5
  %98 = load i32, ptr @n, align 4, !tbaa !5
  %99 = icmp sle i32 %97, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #9
  br label %136

101:                                              ; preds = %96
  %102 = load i32, ptr %5, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %103
  %105 = load i32, ptr %104, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %106
  %108 = load i32, ptr %107, align 4, !tbaa !5
  %109 = icmp eq i32 %108, -1
  br i1 %109, label %110, label %114

110:                                              ; preds = %101
  %111 = load i32, ptr %5, align 4, !tbaa !5
  %112 = sext i32 %111 to i64
  %113 = getelementptr inbounds [50010 x i32], ptr @pre, i64 0, i64 %112
  store i32 -50010, ptr %113, align 4, !tbaa !5
  br label %125

114:                                              ; preds = %101
  %115 = load i32, ptr %5, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %116
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = sext i32 %118 to i64
  %120 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %119
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = load i32, ptr %5, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [50010 x i32], ptr @pre, i64 0, i64 %123
  store i32 %121, ptr %124, align 4, !tbaa !5
  br label %125

125:                                              ; preds = %114, %110
  %126 = load i32, ptr %5, align 4, !tbaa !5
  %127 = load i32, ptr %5, align 4, !tbaa !5
  %128 = sext i32 %127 to i64
  %129 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %128
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %131
  store i32 %126, ptr %132, align 4, !tbaa !5
  br label %133

133:                                              ; preds = %125
  %134 = load i32, ptr %5, align 4, !tbaa !5
  %135 = add nsw i32 %134, 1
  store i32 %135, ptr %5, align 4, !tbaa !5
  br label %96, !llvm.loop !13

136:                                              ; preds = %100
  call void @llvm.memset.p0.i64(ptr align 16 @pos, i8 -1, i64 200040, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #9
  %137 = load i32, ptr @n, align 4, !tbaa !5
  store i32 %137, ptr %6, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %174, %136
  %139 = load i32, ptr %6, align 4, !tbaa !5
  %140 = icmp sge i32 %139, 0
  br i1 %140, label %142, label %141

141:                                              ; preds = %138
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #9
  br label %177

142:                                              ; preds = %138
  %143 = load i32, ptr %6, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %144
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = icmp eq i32 %149, -1
  br i1 %150, label %151, label %155

151:                                              ; preds = %142
  %152 = load i32, ptr %6, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [50010 x i32], ptr @suf, i64 0, i64 %153
  store i32 50010, ptr %154, align 4, !tbaa !5
  br label %166

155:                                              ; preds = %142
  %156 = load i32, ptr %6, align 4, !tbaa !5
  %157 = sext i32 %156 to i64
  %158 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %157
  %159 = load i32, ptr %158, align 4, !tbaa !5
  %160 = sext i32 %159 to i64
  %161 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %160
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = load i32, ptr %6, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds [50010 x i32], ptr @suf, i64 0, i64 %164
  store i32 %162, ptr %165, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %155, %151
  %167 = load i32, ptr %6, align 4, !tbaa !5
  %168 = load i32, ptr %6, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %169
  %171 = load i32, ptr %170, align 4, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %172
  store i32 %167, ptr %173, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %166
  %175 = load i32, ptr %6, align 4, !tbaa !5
  %176 = add nsw i32 %175, -1
  store i32 %176, ptr %6, align 4, !tbaa !5
  br label %138, !llvm.loop !14

177:                                              ; preds = %141
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #9
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %178

178:                                              ; preds = %199, %177
  %179 = load i32, ptr %7, align 4, !tbaa !5
  %180 = load i32, ptr @m, align 4, !tbaa !5
  %181 = icmp slt i32 %179, %180
  br i1 %181, label %183, label %182

182:                                              ; preds = %178
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #9
  br label %202

183:                                              ; preds = %178
  %184 = load i32, ptr %7, align 4, !tbaa !5
  %185 = sext i32 %184 to i64
  %186 = getelementptr inbounds [50010 x i32], ptr @L, i64 0, i64 %185
  call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) %186)
  %187 = load i32, ptr %7, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds [50010 x i32], ptr @R, i64 0, i64 %188
  call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) %189)
  %190 = load i32, ptr %7, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [50010 x i32], ptr @L, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  %194 = add nsw i32 %193, -1
  store i32 %194, ptr %192, align 4, !tbaa !5
  %195 = load i32, ptr %7, align 4, !tbaa !5
  %196 = load i32, ptr %7, align 4, !tbaa !5
  %197 = sext i32 %196 to i64
  %198 = getelementptr inbounds [50010 x i32], ptr @D, i64 0, i64 %197
  store i32 %195, ptr %198, align 4, !tbaa !5
  br label %199

199:                                              ; preds = %183
  %200 = load i32, ptr %7, align 4, !tbaa !5
  %201 = add nsw i32 %200, 1
  store i32 %201, ptr %7, align 4, !tbaa !5
  br label %178, !llvm.loop !15

202:                                              ; preds = %182
  %203 = load i32, ptr @m, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds i32, ptr @D, i64 %204
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef @D, ptr noundef %205, ptr noundef @_Z3cmpRKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #9
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #9
  store i32 0, ptr %9, align 4, !tbaa !5
  %206 = load i32, ptr @tot, align 4, !tbaa !5
  call void @_Z5buildii(i32 noundef 1, i32 noundef %206)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #9
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %207

207:                                              ; preds = %416, %202
  %208 = load i32, ptr %10, align 4, !tbaa !5
  %209 = load i32, ptr @m, align 4, !tbaa !5
  %210 = icmp slt i32 %208, %209
  br i1 %210, label %212, label %211

211:                                              ; preds = %207
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #9
  br label %419

212:                                              ; preds = %207
  call void @llvm.lifetime.start.p0(i64 8, ptr %11) #9
  %213 = load i32, ptr %10, align 4, !tbaa !5
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [50010 x i32], ptr @D, i64 0, i64 %214
  %216 = load i32, ptr %215, align 4, !tbaa !5
  %217 = sext i32 %216 to i64
  %218 = getelementptr inbounds [50010 x i32], ptr @L, i64 0, i64 %217
  store ptr %218, ptr %11, align 8, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #9
  %219 = load i32, ptr %10, align 4, !tbaa !5
  %220 = sext i32 %219 to i64
  %221 = getelementptr inbounds [50010 x i32], ptr @D, i64 0, i64 %220
  %222 = load i32, ptr %221, align 4, !tbaa !5
  %223 = sext i32 %222 to i64
  %224 = getelementptr inbounds [50010 x i32], ptr @R, i64 0, i64 %223
  store ptr %224, ptr %12, align 8, !tbaa !16
  br label %225

225:                                              ; preds = %249, %212
  %226 = load i32, ptr %9, align 4, !tbaa !5
  %227 = load ptr, ptr %12, align 8, !tbaa !16
  %228 = load i32, ptr %227, align 4, !tbaa !5
  %229 = icmp slt i32 %226, %228
  br i1 %229, label %230, label %262

230:                                              ; preds = %225
  %231 = load i32, ptr %9, align 4, !tbaa !5
  %232 = add nsw i32 %231, 1
  store i32 %232, ptr %9, align 4, !tbaa !5
  %233 = load i32, ptr %9, align 4, !tbaa !5
  %234 = sext i32 %233 to i64
  %235 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %234
  %236 = load i32, ptr %235, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %237
  %239 = load i32, ptr %238, align 4, !tbaa !5
  %240 = icmp eq i32 %239, 50010
  br i1 %240, label %241, label %249

241:                                              ; preds = %230
  %242 = load i32, ptr %9, align 4, !tbaa !5
  %243 = load i32, ptr %9, align 4, !tbaa !5
  %244 = sext i32 %243 to i64
  %245 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %244
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %247
  store i32 %242, ptr %248, align 4, !tbaa !5
  br label %249

249:                                              ; preds = %241, %230
  %250 = load i32, ptr %9, align 4, !tbaa !5
  %251 = load i32, ptr %9, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %252
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = sext i32 %254 to i64
  %256 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %255
  store i32 %250, ptr %256, align 4, !tbaa !5
  %257 = load i32, ptr @tot, align 4, !tbaa !5
  %258 = load i32, ptr %9, align 4, !tbaa !5
  %259 = sext i32 %258 to i64
  %260 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %259
  %261 = load i32, ptr %260, align 4, !tbaa !5
  call void @_Z6updateiii(i32 noundef 1, i32 noundef %257, i32 noundef %261)
  br label %225, !llvm.loop !18

262:                                              ; preds = %225
  br label %263

263:                                              ; preds = %299, %262
  %264 = load i32, ptr %9, align 4, !tbaa !5
  %265 = load ptr, ptr %12, align 8, !tbaa !16
  %266 = load i32, ptr %265, align 4, !tbaa !5
  %267 = icmp sgt i32 %264, %266
  br i1 %267, label %268, label %314

268:                                              ; preds = %263
  %269 = load i32, ptr %9, align 4, !tbaa !5
  %270 = sext i32 %269 to i64
  %271 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %270
  %272 = load i32, ptr %271, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !5
  %276 = load i32, ptr %9, align 4, !tbaa !5
  %277 = icmp eq i32 %275, %276
  br i1 %277, label %278, label %285

278:                                              ; preds = %268
  %279 = load i32, ptr %9, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !5
  %283 = sext i32 %282 to i64
  %284 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %283
  store i32 50010, ptr %284, align 4, !tbaa !5
  br label %285

285:                                              ; preds = %278, %268
  %286 = load i32, ptr %9, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [50010 x i32], ptr @pre, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = load ptr, ptr %11, align 8, !tbaa !16
  %291 = load i32, ptr %290, align 4, !tbaa !5
  %292 = icmp sge i32 %289, %291
  br i1 %292, label %293, label %298

293:                                              ; preds = %285
  %294 = load i32, ptr %9, align 4, !tbaa !5
  %295 = sext i32 %294 to i64
  %296 = getelementptr inbounds [50010 x i32], ptr @pre, i64 0, i64 %295
  %297 = load i32, ptr %296, align 4, !tbaa !5
  br label %299

298:                                              ; preds = %285
  br label %299

299:                                              ; preds = %298, %293
  %300 = phi i32 [ %297, %293 ], [ -50010, %298 ]
  %301 = load i32, ptr %9, align 4, !tbaa !5
  %302 = sext i32 %301 to i64
  %303 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %302
  %304 = load i32, ptr %303, align 4, !tbaa !5
  %305 = sext i32 %304 to i64
  %306 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %305
  store i32 %300, ptr %306, align 4, !tbaa !5
  %307 = load i32, ptr @tot, align 4, !tbaa !5
  %308 = load i32, ptr %9, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %309
  %311 = load i32, ptr %310, align 4, !tbaa !5
  call void @_Z6updateiii(i32 noundef 1, i32 noundef %307, i32 noundef %311)
  %312 = load i32, ptr %9, align 4, !tbaa !5
  %313 = add nsw i32 %312, -1
  store i32 %313, ptr %9, align 4, !tbaa !5
  br label %263, !llvm.loop !19

314:                                              ; preds = %263
  br label %315

315:                                              ; preds = %358, %314
  %316 = load i32, ptr %8, align 4, !tbaa !5
  %317 = load ptr, ptr %11, align 8, !tbaa !16
  %318 = load i32, ptr %317, align 4, !tbaa !5
  %319 = icmp slt i32 %316, %318
  br i1 %319, label %320, label %366

320:                                              ; preds = %315
  %321 = load i32, ptr %8, align 4, !tbaa !5
  %322 = sext i32 %321 to i64
  %323 = getelementptr inbounds [50010 x i32], ptr @suf, i64 0, i64 %322
  %324 = load i32, ptr %323, align 4, !tbaa !5
  %325 = load ptr, ptr %12, align 8, !tbaa !16
  %326 = load i32, ptr %325, align 4, !tbaa !5
  %327 = icmp sle i32 %324, %326
  br i1 %327, label %328, label %333

328:                                              ; preds = %320
  %329 = load i32, ptr %8, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [50010 x i32], ptr @suf, i64 0, i64 %330
  %332 = load i32, ptr %331, align 4, !tbaa !5
  br label %334

333:                                              ; preds = %320
  br label %334

334:                                              ; preds = %333, %328
  %335 = phi i32 [ %332, %328 ], [ 50010, %333 ]
  %336 = load i32, ptr %8, align 4, !tbaa !5
  %337 = sext i32 %336 to i64
  %338 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %337
  %339 = load i32, ptr %338, align 4, !tbaa !5
  %340 = sext i32 %339 to i64
  %341 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %340
  store i32 %335, ptr %341, align 4, !tbaa !5
  %342 = load i32, ptr %8, align 4, !tbaa !5
  %343 = sext i32 %342 to i64
  %344 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %343
  %345 = load i32, ptr %344, align 4, !tbaa !5
  %346 = sext i32 %345 to i64
  %347 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %346
  %348 = load i32, ptr %347, align 4, !tbaa !5
  %349 = load i32, ptr %8, align 4, !tbaa !5
  %350 = icmp eq i32 %348, %349
  br i1 %350, label %351, label %358

351:                                              ; preds = %334
  %352 = load i32, ptr %8, align 4, !tbaa !5
  %353 = sext i32 %352 to i64
  %354 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %353
  %355 = load i32, ptr %354, align 4, !tbaa !5
  %356 = sext i32 %355 to i64
  %357 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %356
  store i32 -50010, ptr %357, align 4, !tbaa !5
  br label %358

358:                                              ; preds = %351, %334
  %359 = load i32, ptr @tot, align 4, !tbaa !5
  %360 = load i32, ptr %8, align 4, !tbaa !5
  %361 = sext i32 %360 to i64
  %362 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %361
  %363 = load i32, ptr %362, align 4, !tbaa !5
  call void @_Z6updateiii(i32 noundef 1, i32 noundef %359, i32 noundef %363)
  %364 = load i32, ptr %8, align 4, !tbaa !5
  %365 = add nsw i32 %364, 1
  store i32 %365, ptr %8, align 4, !tbaa !5
  br label %315, !llvm.loop !20

366:                                              ; preds = %315
  br label %367

367:                                              ; preds = %398, %366
  %368 = load i32, ptr %8, align 4, !tbaa !5
  %369 = load ptr, ptr %11, align 8, !tbaa !16
  %370 = load i32, ptr %369, align 4, !tbaa !5
  %371 = icmp sgt i32 %368, %370
  br i1 %371, label %372, label %404

372:                                              ; preds = %367
  %373 = load i32, ptr %8, align 4, !tbaa !5
  %374 = add nsw i32 %373, -1
  store i32 %374, ptr %8, align 4, !tbaa !5
  %375 = load i32, ptr %8, align 4, !tbaa !5
  %376 = load i32, ptr %8, align 4, !tbaa !5
  %377 = sext i32 %376 to i64
  %378 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %377
  %379 = load i32, ptr %378, align 4, !tbaa !5
  %380 = sext i32 %379 to i64
  %381 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %380
  store i32 %375, ptr %381, align 4, !tbaa !5
  %382 = load i32, ptr %8, align 4, !tbaa !5
  %383 = sext i32 %382 to i64
  %384 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %383
  %385 = load i32, ptr %384, align 4, !tbaa !5
  %386 = sext i32 %385 to i64
  %387 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %386
  %388 = load i32, ptr %387, align 4, !tbaa !5
  %389 = icmp eq i32 %388, -50010
  br i1 %389, label %390, label %398

390:                                              ; preds = %372
  %391 = load i32, ptr %8, align 4, !tbaa !5
  %392 = load i32, ptr %8, align 4, !tbaa !5
  %393 = sext i32 %392 to i64
  %394 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %393
  %395 = load i32, ptr %394, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %396
  store i32 %391, ptr %397, align 4, !tbaa !5
  br label %398

398:                                              ; preds = %390, %372
  %399 = load i32, ptr @tot, align 4, !tbaa !5
  %400 = load i32, ptr %8, align 4, !tbaa !5
  %401 = sext i32 %400 to i64
  %402 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %401
  %403 = load i32, ptr %402, align 4, !tbaa !5
  call void @_Z6updateiii(i32 noundef 1, i32 noundef %399, i32 noundef %403)
  br label %367, !llvm.loop !21

404:                                              ; preds = %367
  %405 = load i32, ptr @tot, align 4, !tbaa !5
  %406 = call noundef i32 @_Z2idii(i32 noundef 1, i32 noundef %405)
  %407 = sext i32 %406 to i64
  %408 = getelementptr inbounds [100020 x i32], ptr @seg, i64 0, i64 %407
  %409 = load i32, ptr %408, align 4, !tbaa !5
  %410 = load i32, ptr %10, align 4, !tbaa !5
  %411 = sext i32 %410 to i64
  %412 = getelementptr inbounds [50010 x i32], ptr @D, i64 0, i64 %411
  %413 = load i32, ptr %412, align 4, !tbaa !5
  %414 = sext i32 %413 to i64
  %415 = getelementptr inbounds [50010 x i32], ptr @ans, i64 0, i64 %414
  store i32 %409, ptr %415, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #9
  call void @llvm.lifetime.end.p0(i64 8, ptr %11) #9
  br label %416

416:                                              ; preds = %404
  %417 = load i32, ptr %10, align 4, !tbaa !5
  %418 = add nsw i32 %417, 1
  store i32 %418, ptr %10, align 4, !tbaa !5
  br label %207, !llvm.loop !22

419:                                              ; preds = %211
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #9
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %420

420:                                              ; preds = %431, %419
  %421 = load i32, ptr %13, align 4, !tbaa !5
  %422 = load i32, ptr @m, align 4, !tbaa !5
  %423 = icmp slt i32 %421, %422
  br i1 %423, label %425, label %424

424:                                              ; preds = %420
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #9
  br label %434

425:                                              ; preds = %420
  %426 = load i32, ptr %13, align 4, !tbaa !5
  %427 = sext i32 %426 to i64
  %428 = getelementptr inbounds [50010 x i32], ptr @ans, i64 0, i64 %427
  %429 = load i32, ptr %428, align 4, !tbaa !5
  %430 = call i32 (ptr, ...) @printf(ptr noundef @.str, i32 noundef %429)
  br label %431

431:                                              ; preds = %425
  %432 = load i32, ptr %13, align 4, !tbaa !5
  %433 = add nsw i32 %432, 1
  store i32 %433, ptr %13, align 4, !tbaa !5
  br label %420, !llvm.loop !23

434:                                              ; preds = %424
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #9
  ret i32 0
}

; Function Attrs: nounwind
declare double @sqrt(double noundef) #5

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

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

; 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)) #6

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

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

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

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@tsize = external dso_local local_unnamed_addr global i32, align 4
@s = external dso_local global [50010 x i32], align 16
@pos = external dso_local local_unnamed_addr global [50010 x i32], align 16
@pre = external dso_local local_unnamed_addr global [50010 x i32], align 16
@suf = external dso_local local_unnamed_addr global [50010 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [50010 x i32], align 16
@L = external dso_local global [50010 x i32], align 16
@R = external dso_local global [50010 x i32], align 16
@D = external dso_local global [50010 x i32], align 16
@idn = external dso_local local_unnamed_addr global [50010 x i32], align 16
@idx = external dso_local local_unnamed_addr global [50010 x i32], align 16
@ans = external dso_local local_unnamed_addr global [50010 x i32], align 16
@seg = external dso_local local_unnamed_addr global [100020 x i32], align 16
@.str = external hidden unnamed_addr constant [4 x i8], align 1

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_Z3cmpRKiS0_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 4 dereferenceable(4)) #1

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z5buildii(i32 noundef, i32 noundef) local_unnamed_addr #0

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_Z6updateiii(i32 noundef, i32 noundef, i32 noundef) local_unnamed_addr #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  tail call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) @n)
  tail call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) @m)
  %1 = load i32, ptr @n, align 4, !tbaa !5
  %2 = sitofp i32 %1 to double
  %3 = fadd double %2, 2.330000e-01
  %4 = tail call double @sqrt(double noundef %3) #9
  %5 = fptosi double %4 to i32
  store i32 %5, ptr @tsize, align 4, !tbaa !5
  %6 = load i32, ptr @n, align 4, !tbaa !5
  %.not111 = icmp slt i32 %6, 1
  br i1 %.not111, label %.preheader108, label %.lr.ph

.preheader108:                                    ; preds = %.lr.ph, %0
  %.lcssa110 = phi i32 [ %6, %0 ], [ %20, %.lr.ph ]
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  %.not98113 = icmp slt i32 %.lcssa110, 0
  br i1 %.not98113, label %22, label %.lr.ph115.preheader

.lr.ph115.preheader:                              ; preds = %.preheader108
  %7 = sext i32 %tot.promoted to i64
  %8 = shl nsw i64 %7, 2
  %scevgep = getelementptr i8, ptr @que, i64 %8
  %9 = add nuw i32 %.lcssa110, 1
  %10 = zext i32 %9 to i64
  %11 = shl nuw nsw i64 %10, 2
  tail call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(1) %scevgep, ptr noundef nonnull align 16 dereferenceable(1) @s, i64 %11, i1 false), !tbaa !5
  %12 = add i32 %tot.promoted, %.lcssa110
  %13 = add i32 %12, 1
  store i32 %13, ptr @tot, align 4, !tbaa !5
  br label %22

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %14 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv
  tail call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) %14)
  %15 = add nsw i64 %indvars.iv, -1
  %16 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %15
  %17 = load i32, ptr %16, align 4, !tbaa !5
  %18 = load i32, ptr %14, align 4, !tbaa !5
  %19 = add nsw i32 %18, %17
  store i32 %19, ptr %14, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %20 = load i32, ptr @n, align 4, !tbaa !5
  %21 = sext i32 %20 to i64
  %.not.not = icmp slt i64 %indvars.iv, %21
  br i1 %.not.not, label %.lr.ph, label %.preheader108, !llvm.loop !9

22:                                               ; preds = %.lr.ph115.preheader, %.preheader108
  %23 = phi i32 [ %13, %.lr.ph115.preheader ], [ %tot.promoted, %.preheader108 ]
  %24 = sext i32 %23 to i64
  %25 = getelementptr inbounds i32, ptr @que, i64 %24
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %25)
  %26 = load i32, ptr @tot, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds i32, ptr @que, i64 %27
  %29 = tail call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %28)
  %30 = ptrtoint ptr %29 to i64
  %31 = sub i64 %30, ptrtoint (ptr @que to i64)
  %32 = lshr exact i64 %31, 2
  %33 = trunc i64 %32 to i32
  store i32 %33, ptr @tot, align 4, !tbaa !5
  %34 = load i32, ptr @n, align 4, !tbaa !5
  %.not99117 = icmp slt i32 %34, 0
  br i1 %.not99117, label %._crit_edge127.thread, label %.lr.ph120

._crit_edge121:                                   ; preds = %.lr.ph120
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200040) @pos, i8 -1, i64 200040, i1 false)
  %.not100123 = icmp slt i32 %47, 0
  br i1 %.not100123, label %._crit_edge127.thread, label %.lr.ph126.preheader

.lr.ph126.preheader:                              ; preds = %._crit_edge121
  %35 = add nuw i32 %47, 1
  %wide.trip.count179 = zext i32 %35 to i64
  %xtraiter = and i64 %wide.trip.count179, 1
  %36 = icmp eq i32 %47, 0
  br i1 %36, label %._crit_edge127.unr-lcssa, label %.lr.ph126.preheader.new

.lr.ph126.preheader.new:                          ; preds = %.lr.ph126.preheader
  %unroll_iter = and i64 %wide.trip.count179, 4294967294
  br label %.lr.ph126

.lr.ph120:                                        ; preds = %22, %.lr.ph120
  %indvars.iv173 = phi i64 [ %indvars.iv.next174, %.lr.ph120 ], [ 0, %22 ]
  %37 = load i32, ptr @tot, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds i32, ptr @que, i64 %38
  %40 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv173
  %41 = tail call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %39, ptr noundef nonnull align 4 dereferenceable(4) %40)
  %42 = ptrtoint ptr %41 to i64
  %43 = sub i64 %42, ptrtoint (ptr @que to i64)
  %44 = lshr exact i64 %43, 2
  %45 = trunc i64 %44 to i32
  %46 = add i32 %45, 1
  store i32 %46, ptr %40, align 4, !tbaa !5
  %indvars.iv.next174 = add nuw nsw i64 %indvars.iv173, 1
  %47 = load i32, ptr @n, align 4, !tbaa !5
  %48 = sext i32 %47 to i64
  %.not99.not = icmp slt i64 %indvars.iv173, %48
  br i1 %.not99.not, label %.lr.ph120, label %._crit_edge121, !llvm.loop !11

._crit_edge127.thread:                            ; preds = %22, %._crit_edge121
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200040) @pos, i8 -1, i64 200040, i1 false)
  br label %.preheader107

._crit_edge127.unr-lcssa:                         ; preds = %.lr.ph126, %.lr.ph126.preheader
  %indvars.iv176.unr = phi i64 [ 0, %.lr.ph126.preheader ], [ %indvars.iv.next177.1, %.lr.ph126 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge127, label %.lr.ph126.epil

.lr.ph126.epil:                                   ; preds = %._crit_edge127.unr-lcssa
  %49 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv176.unr
  %50 = load i32, ptr %49, align 4, !tbaa !5
  %51 = sext i32 %50 to i64
  %52 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %51
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp eq i32 %53, -1
  %spec.select217.epil = select i1 %54, i32 -50010, i32 %53
  %55 = getelementptr inbounds [50010 x i32], ptr @pre, i64 0, i64 %indvars.iv176.unr
  store i32 %spec.select217.epil, ptr %55, align 4
  %56 = trunc nuw nsw i64 %indvars.iv176.unr to i32
  store i32 %56, ptr %52, align 4, !tbaa !5
  br label %._crit_edge127

._crit_edge127:                                   ; preds = %._crit_edge127.unr-lcssa, %.lr.ph126.epil
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200040) @pos, i8 -1, i64 200040, i1 false)
  %57 = zext nneg i32 %47 to i64
  %58 = and i64 %57, 1
  %lcmp.mod234.not.not = icmp eq i64 %58, 0
  br i1 %lcmp.mod234.not.not, label %.lr.ph130.prol, label %.lr.ph130.prol.loopexit

.lr.ph130.prol:                                   ; preds = %._crit_edge127
  %59 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %57
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %61
  %63 = load i32, ptr %62, align 4, !tbaa !5
  %64 = icmp eq i32 %63, -1
  %spec.select218.prol = select i1 %64, i32 50010, i32 %63
  %65 = getelementptr inbounds [50010 x i32], ptr @suf, i64 0, i64 %57
  store i32 %spec.select218.prol, ptr %65, align 4
  store i32 %47, ptr %62, align 4, !tbaa !5
  %indvars.iv.next181.prol = add nsw i64 %57, -1
  br label %.lr.ph130.prol.loopexit

.lr.ph130.prol.loopexit:                          ; preds = %.lr.ph130.prol, %._crit_edge127
  %indvars.iv180.unr = phi i64 [ %57, %._crit_edge127 ], [ %indvars.iv.next181.prol, %.lr.ph130.prol ]
  %66 = icmp eq i32 %47, 0
  br i1 %66, label %.preheader107, label %.lr.ph130

.lr.ph126:                                        ; preds = %.lr.ph126, %.lr.ph126.preheader.new
  %indvars.iv176 = phi i64 [ 0, %.lr.ph126.preheader.new ], [ %indvars.iv.next177.1, %.lr.ph126 ]
  %niter = phi i64 [ 0, %.lr.ph126.preheader.new ], [ %niter.next.1, %.lr.ph126 ]
  %67 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv176
  %68 = load i32, ptr %67, align 8, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %69
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = icmp eq i32 %71, -1
  %spec.select217 = select i1 %72, i32 -50010, i32 %71
  %73 = getelementptr inbounds [50010 x i32], ptr @pre, i64 0, i64 %indvars.iv176
  store i32 %spec.select217, ptr %73, align 8
  %74 = trunc nuw nsw i64 %indvars.iv176 to i32
  store i32 %74, ptr %70, align 4, !tbaa !5
  %indvars.iv.next177 = or disjoint i64 %indvars.iv176, 1
  %75 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv.next177
  %76 = load i32, ptr %75, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = icmp eq i32 %79, -1
  %spec.select217.1 = select i1 %80, i32 -50010, i32 %79
  %81 = getelementptr inbounds [50010 x i32], ptr @pre, i64 0, i64 %indvars.iv.next177
  store i32 %spec.select217.1, ptr %81, align 4
  %82 = trunc nuw nsw i64 %indvars.iv.next177 to i32
  store i32 %82, ptr %78, align 4, !tbaa !5
  %indvars.iv.next177.1 = add nuw nsw i64 %indvars.iv176, 2
  %niter.next.1 = add i64 %niter, 2
  %niter.ncmp.1 = icmp eq i64 %niter.next.1, %unroll_iter
  br i1 %niter.ncmp.1, label %._crit_edge127.unr-lcssa, label %.lr.ph126, !llvm.loop !12

.preheader107:                                    ; preds = %.lr.ph130.prol.loopexit, %.lr.ph130, %._crit_edge127.thread
  %83 = load i32, ptr @m, align 4, !tbaa !5
  %84 = icmp sgt i32 %83, 0
  br i1 %84, label %.lr.ph132, label %.preheader107.._crit_edge133_crit_edge

.preheader107.._crit_edge133_crit_edge:           ; preds = %.preheader107
  %.pre = sext i32 %83 to i64
  br label %._crit_edge133

.lr.ph130:                                        ; preds = %.lr.ph130.prol.loopexit, %.lr.ph130
  %indvars.iv180 = phi i64 [ %indvars.iv.next181.1, %.lr.ph130 ], [ %indvars.iv180.unr, %.lr.ph130.prol.loopexit ]
  %85 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv180
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %87
  %89 = load i32, ptr %88, align 4, !tbaa !5
  %90 = icmp eq i32 %89, -1
  %spec.select218 = select i1 %90, i32 50010, i32 %89
  %91 = getelementptr inbounds [50010 x i32], ptr @suf, i64 0, i64 %indvars.iv180
  store i32 %spec.select218, ptr %91, align 4
  %92 = trunc nuw nsw i64 %indvars.iv180 to i32
  store i32 %92, ptr %88, align 4, !tbaa !5
  %indvars.iv.next181 = add nsw i64 %indvars.iv180, -1
  %93 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv.next181
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [50010 x i32], ptr @pos, i64 0, i64 %95
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = icmp eq i32 %97, -1
  %spec.select218.1 = select i1 %98, i32 50010, i32 %97
  %99 = getelementptr inbounds [50010 x i32], ptr @suf, i64 0, i64 %indvars.iv.next181
  store i32 %spec.select218.1, ptr %99, align 4
  %100 = trunc nuw nsw i64 %indvars.iv.next181 to i32
  store i32 %100, ptr %96, align 4, !tbaa !5
  %indvars.iv.next181.1 = add nsw i64 %indvars.iv180, -2
  %101 = icmp sgt i64 %indvars.iv180, 1
  br i1 %101, label %.lr.ph130, label %.preheader107, !llvm.loop !13

._crit_edge133:                                   ; preds = %.lr.ph132, %.preheader107.._crit_edge133_crit_edge
  %.pre-phi = phi i64 [ %.pre, %.preheader107.._crit_edge133_crit_edge ], [ %113, %.lr.ph132 ]
  %102 = getelementptr inbounds i32, ptr @D, i64 %.pre-phi
  tail call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull @D, ptr noundef nonnull %102, ptr noundef nonnull @_Z3cmpRKiS0_)
  %103 = load i32, ptr @tot, align 4, !tbaa !5
  tail call void @_Z5buildii(i32 noundef 1, i32 noundef %103)
  %104 = load i32, ptr @m, align 4, !tbaa !5
  %105 = icmp sgt i32 %104, 0
  br i1 %105, label %.lr.ph153, label %._crit_edge156

.lr.ph132:                                        ; preds = %.preheader107, %.lr.ph132
  %indvars.iv183 = phi i64 [ %indvars.iv.next184, %.lr.ph132 ], [ 0, %.preheader107 ]
  %106 = getelementptr inbounds [50010 x i32], ptr @L, i64 0, i64 %indvars.iv183
  tail call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) %106)
  %107 = getelementptr inbounds [50010 x i32], ptr @R, i64 0, i64 %indvars.iv183
  tail call void @_Z4scanRi(ptr noundef nonnull align 4 dereferenceable(4) %107)
  %108 = load i32, ptr %106, align 4, !tbaa !5
  %109 = add nsw i32 %108, -1
  store i32 %109, ptr %106, align 4, !tbaa !5
  %110 = getelementptr inbounds [50010 x i32], ptr @D, i64 0, i64 %indvars.iv183
  %111 = trunc nuw nsw i64 %indvars.iv183 to i32
  store i32 %111, ptr %110, align 4, !tbaa !5
  %indvars.iv.next184 = add nuw nsw i64 %indvars.iv183, 1
  %112 = load i32, ptr @m, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = icmp slt i64 %indvars.iv.next184, %113
  br i1 %114, label %.lr.ph132, label %._crit_edge133, !llvm.loop !14

.preheader:                                       ; preds = %._crit_edge147
  %115 = icmp sgt i32 %204, 0
  br i1 %115, label %.lr.ph155, label %._crit_edge156

.lr.ph153:                                        ; preds = %._crit_edge133, %._crit_edge147
  %indvars.iv198 = phi i64 [ %indvars.iv.next199, %._crit_edge147 ], [ 0, %._crit_edge133 ]
  %.085150 = phi i32 [ %.2.lcssa, %._crit_edge147 ], [ 0, %._crit_edge133 ]
  %.086149 = phi i32 [ %.288.lcssa, %._crit_edge147 ], [ 0, %._crit_edge133 ]
  %116 = getelementptr inbounds [50010 x i32], ptr @D, i64 0, i64 %indvars.iv198
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [50010 x i32], ptr @L, i64 0, i64 %118
  %120 = getelementptr inbounds [50010 x i32], ptr @R, i64 0, i64 %118
  %121 = load i32, ptr %120, align 4, !tbaa !5
  %122 = icmp slt i32 %.085150, %121
  br i1 %122, label %.lr.ph137.preheader, label %.preheader106

.lr.ph137.preheader:                              ; preds = %.lr.ph153
  %123 = sext i32 %.085150 to i64
  br label %.lr.ph137

.preheader106:                                    ; preds = %.lr.ph137._crit_edge, %.lr.ph153
  %124 = phi i32 [ %121, %.lr.ph153 ], [ %137, %.lr.ph137._crit_edge ]
  %.1.lcssa = phi i32 [ %.085150, %.lr.ph153 ], [ %133, %.lr.ph137._crit_edge ]
  %125 = icmp sgt i32 %.1.lcssa, %124
  br i1 %125, label %.lr.ph140.preheader, label %.preheader105

.lr.ph140.preheader:                              ; preds = %.preheader106
  %126 = sext i32 %.1.lcssa to i64
  br label %.lr.ph140

.lr.ph137:                                        ; preds = %.lr.ph137.preheader, %.lr.ph137._crit_edge
  %indvars.iv186 = phi i64 [ %123, %.lr.ph137.preheader ], [ %indvars.iv.next187, %.lr.ph137._crit_edge ]
  %indvars.iv.next187 = add nsw i64 %indvars.iv186, 1
  %127 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv.next187
  %128 = load i32, ptr %127, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = icmp eq i32 %131, 50010
  %133 = trunc nsw i64 %indvars.iv.next187 to i32
  br i1 %132, label %134, label %.lr.ph137._crit_edge

134:                                              ; preds = %.lr.ph137
  store i32 %133, ptr %130, align 4, !tbaa !5
  br label %.lr.ph137._crit_edge

.lr.ph137._crit_edge:                             ; preds = %.lr.ph137, %134
  %135 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %129
  store i32 %133, ptr %135, align 4, !tbaa !5
  %136 = load i32, ptr @tot, align 4, !tbaa !5
  tail call void @_Z6updateiii(i32 noundef 1, i32 noundef %136, i32 noundef %128)
  %137 = load i32, ptr %120, align 4, !tbaa !5
  %138 = sext i32 %137 to i64
  %139 = icmp slt i64 %indvars.iv.next187, %138
  br i1 %139, label %.lr.ph137, label %.preheader106, !llvm.loop !15

.preheader105.loopexit:                           ; preds = %152
  %140 = trunc nsw i64 %indvars.iv.next190 to i32
  br label %.preheader105

.preheader105:                                    ; preds = %.preheader105.loopexit, %.preheader106
  %.2.lcssa = phi i32 [ %.1.lcssa, %.preheader106 ], [ %140, %.preheader105.loopexit ]
  %141 = load i32, ptr %119, align 4, !tbaa !5
  %142 = icmp slt i32 %.086149, %141
  br i1 %142, label %.lr.ph143.preheader, label %.preheader104

.lr.ph143.preheader:                              ; preds = %.preheader105
  %143 = sext i32 %.086149 to i64
  br label %.lr.ph143

.lr.ph140:                                        ; preds = %.lr.ph140.preheader, %152
  %indvars.iv189 = phi i64 [ %126, %.lr.ph140.preheader ], [ %indvars.iv.next190, %152 ]
  %144 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv189
  %145 = load i32, ptr %144, align 4, !tbaa !5
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %146
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = trunc nsw i64 %indvars.iv189 to i32
  %150 = icmp eq i32 %148, %149
  br i1 %150, label %151, label %152

151:                                              ; preds = %.lr.ph140
  store i32 50010, ptr %147, align 4, !tbaa !5
  br label %152

152:                                              ; preds = %151, %.lr.ph140
  %153 = getelementptr inbounds [50010 x i32], ptr @pre, i64 0, i64 %indvars.iv189
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %155 = load i32, ptr %119, align 4, !tbaa !5
  %.not102 = icmp slt i32 %154, %155
  %spec.select = select i1 %.not102, i32 -50010, i32 %154
  %156 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %146
  store i32 %spec.select, ptr %156, align 4, !tbaa !5
  %157 = load i32, ptr @tot, align 4, !tbaa !5
  tail call void @_Z6updateiii(i32 noundef 1, i32 noundef %157, i32 noundef %145)
  %indvars.iv.next190 = add nsw i64 %indvars.iv189, -1
  %158 = load i32, ptr %120, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = icmp sgt i64 %indvars.iv.next190, %159
  br i1 %160, label %.lr.ph140, label %.preheader105.loopexit, !llvm.loop !16

.preheader104.loopexit:                           ; preds = %177
  %161 = trunc nsw i64 %indvars.iv.next193 to i32
  br label %.preheader104

.preheader104:                                    ; preds = %.preheader104.loopexit, %.preheader105
  %162 = phi i32 [ %141, %.preheader105 ], [ %179, %.preheader104.loopexit ]
  %.187.lcssa = phi i32 [ %.086149, %.preheader105 ], [ %161, %.preheader104.loopexit ]
  %163 = icmp sgt i32 %.187.lcssa, %162
  br i1 %163, label %.lr.ph146.preheader, label %._crit_edge147

.lr.ph146.preheader:                              ; preds = %.preheader104
  %164 = sext i32 %.187.lcssa to i64
  br label %.lr.ph146

.lr.ph143:                                        ; preds = %.lr.ph143.preheader, %177
  %indvars.iv192 = phi i64 [ %143, %.lr.ph143.preheader ], [ %indvars.iv.next193, %177 ]
  %165 = getelementptr inbounds [50010 x i32], ptr @suf, i64 0, i64 %indvars.iv192
  %166 = load i32, ptr %165, align 4, !tbaa !5
  %167 = load i32, ptr %120, align 4, !tbaa !5
  %.not101 = icmp sgt i32 %166, %167
  %spec.select103 = select i1 %.not101, i32 50010, i32 %166
  %168 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv192
  %169 = load i32, ptr %168, align 4, !tbaa !5
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %170
  store i32 %spec.select103, ptr %171, align 4, !tbaa !5
  %172 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %170
  %173 = load i32, ptr %172, align 4, !tbaa !5
  %174 = trunc nsw i64 %indvars.iv192 to i32
  %175 = icmp eq i32 %173, %174
  br i1 %175, label %176, label %177

176:                                              ; preds = %.lr.ph143
  store i32 -50010, ptr %172, align 4, !tbaa !5
  br label %177

177:                                              ; preds = %176, %.lr.ph143
  %178 = load i32, ptr @tot, align 4, !tbaa !5
  tail call void @_Z6updateiii(i32 noundef 1, i32 noundef %178, i32 noundef %169)
  %indvars.iv.next193 = add nsw i64 %indvars.iv192, 1
  %179 = load i32, ptr %119, align 4, !tbaa !5
  %180 = sext i32 %179 to i64
  %181 = icmp slt i64 %indvars.iv.next193, %180
  br i1 %181, label %.lr.ph143, label %.preheader104.loopexit, !llvm.loop !17

.lr.ph146:                                        ; preds = %.lr.ph146.preheader, %191
  %indvars.iv195 = phi i64 [ %164, %.lr.ph146.preheader ], [ %indvars.iv.next196, %191 ]
  %indvars.iv.next196 = add nsw i64 %indvars.iv195, -1
  %182 = getelementptr inbounds [50010 x i32], ptr @s, i64 0, i64 %indvars.iv.next196
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [50010 x i32], ptr @idn, i64 0, i64 %184
  %186 = trunc nsw i64 %indvars.iv.next196 to i32
  store i32 %186, ptr %185, align 4, !tbaa !5
  %187 = getelementptr inbounds [50010 x i32], ptr @idx, i64 0, i64 %184
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = icmp eq i32 %188, -50010
  br i1 %189, label %190, label %191

190:                                              ; preds = %.lr.ph146
  store i32 %186, ptr %187, align 4, !tbaa !5
  br label %191

191:                                              ; preds = %190, %.lr.ph146
  %192 = load i32, ptr @tot, align 4, !tbaa !5
  tail call void @_Z6updateiii(i32 noundef 1, i32 noundef %192, i32 noundef %183)
  %193 = load i32, ptr %119, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = icmp sgt i64 %indvars.iv.next196, %194
  br i1 %195, label %.lr.ph146, label %._crit_edge147, !llvm.loop !18

._crit_edge147:                                   ; preds = %191, %.preheader104
  %.288.lcssa = phi i32 [ %.187.lcssa, %.preheader104 ], [ %186, %191 ]
  %196 = load i32, ptr @tot, align 4, !tbaa !5
  %197 = tail call noundef i32 @_Z2idii(i32 noundef 1, i32 noundef %196)
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [100020 x i32], ptr @seg, i64 0, i64 %198
  %200 = load i32, ptr %199, align 4, !tbaa !5
  %201 = load i32, ptr %116, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [50010 x i32], ptr @ans, i64 0, i64 %202
  store i32 %200, ptr %203, align 4, !tbaa !5
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %204 = load i32, ptr @m, align 4, !tbaa !5
  %205 = sext i32 %204 to i64
  %206 = icmp slt i64 %indvars.iv.next199, %205
  br i1 %206, label %.lr.ph153, label %.preheader, !llvm.loop !19

._crit_edge156:                                   ; preds = %.lr.ph155, %._crit_edge133, %.preheader
  ret i32 0

.lr.ph155:                                        ; preds = %.preheader, %.lr.ph155
  %indvars.iv201 = phi i64 [ %indvars.iv.next202, %.lr.ph155 ], [ 0, %.preheader ]
  %207 = getelementptr inbounds [50010 x i32], ptr @ans, i64 0, i64 %indvars.iv201
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = tail call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str, i32 noundef %208)
  %indvars.iv.next202 = add nuw nsw i64 %indvars.iv201, 1
  %210 = load i32, ptr @m, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = icmp slt i64 %indvars.iv.next202, %211
  br i1 %212, label %.lr.ph155, label %._crit_edge156, !llvm.loop !20
}

; Function Attrs: mustprogress nofree nounwind willreturn memory(write)
declare double @sqrt(double noundef) 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: mustprogress nocallback nofree nounwind willreturn memory(argmem: write)
declare void @llvm.memset.p0.i64(ptr nocapture writeonly, i8, i64, i1 immarg) #6

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #8

attributes #0 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { mustprogress 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 #2 = { 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 #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 = { mustprogress nofree nounwind willreturn memory(write) "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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #7 = { 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 #8 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #9 = { 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}
!19 = distinct !{!19, !10}
!20 = distinct !{!20, !10}


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