; LLVM IR from tangjz/acm-icpc :: codechef/ACM15AMR (AMCOP)

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

%struct.Query = type { i32, i32, i32 }

@fact = external dso_local global [50001 x i32], align 16
@iact = external dso_local global [50001 x i32], align 16
@tot = external dso_local global i32, align 4
@pr = external dso_local global [100001 x i32], align 16
@d = external dso_local global [100001 x i32], align 16
@idx = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@pp = external dso_local global [7 x i32], align 16
@c = external dso_local global [100001 x i32], align 16
@s = external dso_local global [50001 x i32], align 16
@pos = external dso_local global [50001 x i32], align 16
@qtot = external dso_local global i32, align 4
@que = external dso_local global [3200001 x i32], align 16
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@sqn = external dso_local global i32, align 4
@sz = external dso_local global [50001 x i32], align 16
@lpos = external dso_local global [50001 x i32], align 16
@ord = external dso_local global [50001 x i32], align 16
@ans = external dso_local global [50001 x i32], align 16
@query = external dso_local global [50001 x %struct.Query], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #3 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca i32, align 4
  %20 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  store i32 2, ptr %2, align 4, !tbaa !5
  br label %21

21:                                               ; preds = %74, %0
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = icmp slt i32 %22, 100001
  br i1 %23, label %25, label %24

24:                                               ; preds = %21
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %77

25:                                               ; preds = %21
  %26 = load i32, ptr %2, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %27
  %29 = load i32, ptr %28, align 4, !tbaa !5
  %30 = icmp ne i32 %29, 0
  br i1 %30, label %40, label %31

31:                                               ; preds = %25
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr %2, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %34
  store i32 %32, ptr %35, align 4, !tbaa !5
  %36 = load i32, ptr @tot, align 4, !tbaa !5
  %37 = add nsw i32 %36, 1
  store i32 %37, ptr @tot, align 4, !tbaa !5
  %38 = sext i32 %36 to i64
  %39 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %38
  store i32 %32, ptr %39, align 4, !tbaa !5
  br label %40

40:                                               ; preds = %31, %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #8
  store i32 0, ptr %4, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #8
  br label %41

41:                                               ; preds = %69, %40
  %42 = load i32, ptr %2, align 4, !tbaa !5
  %43 = load i32, ptr %4, align 4, !tbaa !5
  %44 = sext i32 %43 to i64
  %45 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %44
  %46 = load i32, ptr %45, align 4, !tbaa !5
  %47 = mul nsw i32 %42, %46
  store i32 %47, ptr %5, align 4, !tbaa !5
  %48 = icmp slt i32 %47, 100001
  br i1 %48, label %50, label %49

49:                                               ; preds = %41
  store i32 5, ptr %3, align 4
  br label %72

50:                                               ; preds = %41
  %51 = load i32, ptr %4, align 4, !tbaa !5
  %52 = sext i32 %51 to i64
  %53 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %52
  %54 = load i32, ptr %53, align 4, !tbaa !5
  %55 = load i32, ptr %5, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %56
  store i32 %54, ptr %57, align 4, !tbaa !5
  %58 = load i32, ptr %2, align 4, !tbaa !5
  %59 = sext i32 %58 to i64
  %60 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %59
  %61 = load i32, ptr %60, align 4, !tbaa !5
  %62 = load i32, ptr %4, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %63
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp eq i32 %61, %65
  br i1 %66, label %67, label %68

67:                                               ; preds = %50
  store i32 5, ptr %3, align 4
  br label %72

68:                                               ; preds = %50
  br label %69

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

72:                                               ; preds = %67, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #8
  br label %73

73:                                               ; preds = %72
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %2, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %2, align 4, !tbaa !5
  br label %21, !llvm.loop !11

77:                                               ; preds = %24
  store i32 1, ptr getelementptr inbounds ([50001 x i32], ptr @iact, i64 0, i64 1), align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  store i32 2, ptr %6, align 4, !tbaa !5
  br label %78

78:                                               ; preds = %99, %77
  %79 = load i32, ptr %6, align 4, !tbaa !5
  %80 = icmp slt i32 %79, 50001
  br i1 %80, label %82, label %81

81:                                               ; preds = %78
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  br label %102

82:                                               ; preds = %78
  %83 = load i32, ptr %6, align 4, !tbaa !5
  %84 = sdiv i32 1000000007, %83
  %85 = sext i32 %84 to i64
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = srem i32 1000000007, %86
  %88 = sext i32 %87 to i64
  %89 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %88
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = mul nsw i64 %85, %91
  %93 = srem i64 %92, 1000000007
  %94 = trunc i64 %93 to i32
  %95 = sub nsw i32 1000000007, %94
  %96 = load i32, ptr %6, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %97
  store i32 %95, ptr %98, align 4, !tbaa !5
  br label %99

99:                                               ; preds = %82
  %100 = load i32, ptr %6, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  store i32 %101, ptr %6, align 4, !tbaa !5
  br label %78, !llvm.loop !12

102:                                              ; preds = %81
  store i32 1, ptr @iact, align 16, !tbaa !5
  store i32 1, ptr @fact, align 16, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 1, ptr %7, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %139, %102
  %104 = load i32, ptr %7, align 4, !tbaa !5
  %105 = icmp slt i32 %104, 50001
  br i1 %105, label %107, label %106

106:                                              ; preds = %103
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %142

107:                                              ; preds = %103
  %108 = load i32, ptr %7, align 4, !tbaa !5
  %109 = sub nsw i32 %108, 1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [50001 x i32], ptr @fact, i64 0, i64 %110
  %112 = load i32, ptr %111, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = load i32, ptr %7, align 4, !tbaa !5
  %115 = sext i32 %114 to i64
  %116 = mul nsw i64 %113, %115
  %117 = srem i64 %116, 1000000007
  %118 = trunc i64 %117 to i32
  %119 = load i32, ptr %7, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [50001 x i32], ptr @fact, i64 0, i64 %120
  store i32 %118, ptr %121, align 4, !tbaa !5
  %122 = load i32, ptr %7, align 4, !tbaa !5
  %123 = sub nsw i32 %122, 1
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %124
  %126 = load i32, ptr %125, align 4, !tbaa !5
  %127 = sext i32 %126 to i64
  %128 = load i32, ptr %7, align 4, !tbaa !5
  %129 = sext i32 %128 to i64
  %130 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %129
  %131 = load i32, ptr %130, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = mul nsw i64 %127, %132
  %134 = srem i64 %133, 1000000007
  %135 = trunc i64 %134 to i32
  %136 = load i32, ptr %7, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %137
  store i32 %135, ptr %138, align 4, !tbaa !5
  br label %139

139:                                              ; preds = %107
  %140 = load i32, ptr %7, align 4, !tbaa !5
  %141 = add nsw i32 %140, 1
  store i32 %141, ptr %7, align 4, !tbaa !5
  br label %103, !llvm.loop !13

142:                                              ; preds = %106
  br label %143

143:                                              ; preds = %438, %142
  %144 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  %145 = icmp eq i32 %144, 1
  br i1 %145, label %146, label %439

146:                                              ; preds = %143
  store i32 361, ptr @sqn, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  br label %147

147:                                              ; preds = %217, %146
  %148 = load i32, ptr %9, align 4, !tbaa !5
  %149 = load i32, ptr @n, align 4, !tbaa !5
  %150 = icmp sle i32 %148, %149
  br i1 %150, label %152, label %151

151:                                              ; preds = %147
  store i32 16, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %220

152:                                              ; preds = %147
  %153 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %10)
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %8, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %155 = load i32, ptr %154, align 4, !tbaa !5
  store i32 %155, ptr %8, align 4, !tbaa !5
  store i32 0, ptr @cnt, align 4, !tbaa !5
  br label %156

156:                                              ; preds = %192, %152
  %157 = load i32, ptr %10, align 4, !tbaa !5
  %158 = icmp sgt i32 %157, 1
  br i1 %158, label %159, label %195

159:                                              ; preds = %156
  %160 = load i32, ptr %10, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %161
  %163 = load i32, ptr %162, align 4, !tbaa !5
  %164 = load i32, ptr @cnt, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [7 x i32], ptr @pp, i64 0, i64 %165
  store i32 %163, ptr %166, align 4, !tbaa !5
  %167 = load i32, ptr @cnt, align 4, !tbaa !5
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [7 x i32], ptr @pp, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = load i32, ptr %10, align 4, !tbaa !5
  %172 = sdiv i32 %171, %170
  store i32 %172, ptr %10, align 4, !tbaa !5
  br label %173

173:                                              ; preds = %184, %159
  %174 = load i32, ptr %10, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %175
  %177 = load i32, ptr %176, align 4, !tbaa !5
  %178 = load i32, ptr @cnt, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [7 x i32], ptr @pp, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = icmp eq i32 %177, %181
  br i1 %182, label %183, label %191

183:                                              ; preds = %173
  br label %184

184:                                              ; preds = %183
  %185 = load i32, ptr @cnt, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [7 x i32], ptr @pp, i64 0, i64 %186
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = load i32, ptr %10, align 4, !tbaa !5
  %190 = sdiv i32 %189, %188
  store i32 %190, ptr %10, align 4, !tbaa !5
  br label %173, !llvm.loop !14

191:                                              ; preds = %173
  br label %192

192:                                              ; preds = %191
  %193 = load i32, ptr @cnt, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr @cnt, align 4, !tbaa !5
  br label %156, !llvm.loop !15

195:                                              ; preds = %156
  %196 = load i32, ptr %9, align 4, !tbaa !5
  store i32 %196, ptr @idx, align 4, !tbaa !5
  %197 = load i32, ptr %9, align 4, !tbaa !5
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [50001 x i32], ptr @sz, i64 0, i64 %198
  store i32 0, ptr %199, align 4, !tbaa !5
  call void @_Z3dfsiii(i32 noundef 0, i32 noundef 1, i32 noundef 1)
  %200 = load i32, ptr %9, align 4, !tbaa !5
  %201 = load i32, ptr @sqn, align 4, !tbaa !5
  %202 = icmp sle i32 %200, %201
  br i1 %202, label %203, label %204

203:                                              ; preds = %195
  br label %212

204:                                              ; preds = %195
  %205 = load i32, ptr %9, align 4, !tbaa !5
  %206 = load i32, ptr @sqn, align 4, !tbaa !5
  %207 = sub nsw i32 %205, %206
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [50001 x i32], ptr @lpos, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  %211 = add nsw i32 %210, 1
  br label %212

212:                                              ; preds = %204, %203
  %213 = phi i32 [ 1, %203 ], [ %211, %204 ]
  %214 = load i32, ptr %9, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = getelementptr inbounds [50001 x i32], ptr @lpos, i64 0, i64 %215
  store i32 %213, ptr %216, align 4, !tbaa !5
  br label %217

217:                                              ; preds = %212
  %218 = load i32, ptr %9, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %9, align 4, !tbaa !5
  br label %147, !llvm.loop !16

220:                                              ; preds = %151
  %221 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 1, ptr %11, align 4, !tbaa !5
  br label %222

222:                                              ; preds = %245, %220
  %223 = load i32, ptr %11, align 4, !tbaa !5
  %224 = load i32, ptr @q, align 4, !tbaa !5
  %225 = icmp sle i32 %223, %224
  br i1 %225, label %227, label %226

226:                                              ; preds = %222
  store i32 25, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %248

227:                                              ; preds = %222
  %228 = load i32, ptr %11, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %229
  %231 = getelementptr inbounds %struct.Query, ptr %230, i32 0, i32 0
  %232 = load i32, ptr %11, align 4, !tbaa !5
  %233 = sext i32 %232 to i64
  %234 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %233
  %235 = getelementptr inbounds %struct.Query, ptr %234, i32 0, i32 1
  %236 = load i32, ptr %11, align 4, !tbaa !5
  %237 = sext i32 %236 to i64
  %238 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %237
  %239 = getelementptr inbounds %struct.Query, ptr %238, i32 0, i32 2
  %240 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %231, ptr noundef %235, ptr noundef %239)
  %241 = load i32, ptr %11, align 4, !tbaa !5
  %242 = load i32, ptr %11, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %243
  store i32 %241, ptr %244, align 4, !tbaa !5
  br label %245

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

248:                                              ; preds = %226
  %249 = load i32, ptr @q, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds i32, ptr @ord, i64 %250
  %252 = getelementptr inbounds i32, ptr %251, i64 1
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef getelementptr inbounds (i32, ptr @ord, i64 1), ptr noundef %252, ptr noundef @_Z3cmpRKiS0_)
  %253 = load i32, ptr %8, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = mul i64 %254, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @c, i64 1), i8 0, i64 %255, i1 false)
  %256 = load i32, ptr @n, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = mul i64 %257, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @s, i64 1), i8 0, i64 %258, i1 false)
  %259 = load i32, ptr @n, align 4, !tbaa !5
  %260 = sext i32 %259 to i64
  %261 = mul i64 %260, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @pos, i64 1), i8 -1, i64 %261, i1 false)
  store i32 0, ptr @qtot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 1, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %262

262:                                              ; preds = %420, %248
  %263 = load i32, ptr %12, align 4, !tbaa !5
  %264 = load i32, ptr @q, align 4, !tbaa !5
  %265 = icmp sle i32 %263, %264
  br i1 %265, label %267, label %266

266:                                              ; preds = %262
  store i32 28, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %423

267:                                              ; preds = %262
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  %268 = load i32, ptr %12, align 4, !tbaa !5
  %269 = sext i32 %268 to i64
  %270 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %269
  %271 = load i32, ptr %270, align 4, !tbaa !5
  store i32 %271, ptr %15, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %272 = load i32, ptr %15, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %273
  %275 = getelementptr inbounds %struct.Query, ptr %274, i32 0, i32 2
  %276 = load i32, ptr %275, align 4, !tbaa !18
  store i32 %276, ptr %16, align 4, !tbaa !5
  br label %277

277:                                              ; preds = %286, %267
  %278 = load i32, ptr %13, align 4, !tbaa !5
  %279 = load i32, ptr %15, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %280
  %282 = getelementptr inbounds %struct.Query, ptr %281, i32 0, i32 0
  %283 = load i32, ptr %282, align 4, !tbaa !20
  %284 = icmp sgt i32 %278, %283
  br i1 %284, label %285, label %289

285:                                              ; preds = %277
  br label %286

286:                                              ; preds = %285
  %287 = load i32, ptr %13, align 4, !tbaa !5
  %288 = add nsw i32 %287, -1
  store i32 %288, ptr %13, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %288, i32 noundef 1)
  br label %277, !llvm.loop !21

289:                                              ; preds = %277
  br label %290

290:                                              ; preds = %299, %289
  %291 = load i32, ptr %14, align 4, !tbaa !5
  %292 = load i32, ptr %15, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %293
  %295 = getelementptr inbounds %struct.Query, ptr %294, i32 0, i32 1
  %296 = load i32, ptr %295, align 4, !tbaa !22
  %297 = icmp slt i32 %291, %296
  br i1 %297, label %298, label %302

298:                                              ; preds = %290
  br label %299

299:                                              ; preds = %298
  %300 = load i32, ptr %14, align 4, !tbaa !5
  %301 = add nsw i32 %300, 1
  store i32 %301, ptr %14, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %301, i32 noundef 1)
  br label %290, !llvm.loop !23

302:                                              ; preds = %290
  br label %303

303:                                              ; preds = %312, %302
  %304 = load i32, ptr %14, align 4, !tbaa !5
  %305 = load i32, ptr %15, align 4, !tbaa !5
  %306 = sext i32 %305 to i64
  %307 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %306
  %308 = getelementptr inbounds %struct.Query, ptr %307, i32 0, i32 1
  %309 = load i32, ptr %308, align 4, !tbaa !22
  %310 = icmp sgt i32 %304, %309
  br i1 %310, label %311, label %315

311:                                              ; preds = %303
  br label %312

312:                                              ; preds = %311
  %313 = load i32, ptr %14, align 4, !tbaa !5
  %314 = add nsw i32 %313, -1
  store i32 %314, ptr %14, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %313, i32 noundef -1)
  br label %303, !llvm.loop !24

315:                                              ; preds = %303
  br label %316

316:                                              ; preds = %325, %315
  %317 = load i32, ptr %13, align 4, !tbaa !5
  %318 = load i32, ptr %15, align 4, !tbaa !5
  %319 = sext i32 %318 to i64
  %320 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %319
  %321 = getelementptr inbounds %struct.Query, ptr %320, i32 0, i32 0
  %322 = load i32, ptr %321, align 4, !tbaa !20
  %323 = icmp slt i32 %317, %322
  br i1 %323, label %324, label %328

324:                                              ; preds = %316
  br label %325

325:                                              ; preds = %324
  %326 = load i32, ptr %13, align 4, !tbaa !5
  %327 = add nsw i32 %326, 1
  store i32 %327, ptr %13, align 4, !tbaa !5
  call void @_Z3updii(i32 noundef %326, i32 noundef -1)
  br label %316, !llvm.loop !25

328:                                              ; preds = %316
  %329 = load i32, ptr %15, align 4, !tbaa !5
  %330 = sext i32 %329 to i64
  %331 = getelementptr inbounds [50001 x i32], ptr @ans, i64 0, i64 %330
  store i32 0, ptr %331, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #8
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %332

332:                                              ; preds = %398, %328
  %333 = load i32, ptr %18, align 4, !tbaa !5
  %334 = load i32, ptr @qtot, align 4, !tbaa !5
  %335 = icmp slt i32 %333, %334
  br i1 %335, label %337, label %336

336:                                              ; preds = %332
  store i32 43, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #8
  br label %401

337:                                              ; preds = %332
  %338 = load i32, ptr %18, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [3200001 x i32], ptr @que, i64 0, i64 %339
  %341 = load i32, ptr %340, align 4, !tbaa !5
  %342 = sext i32 %341 to i64
  %343 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %342
  %344 = load i32, ptr %343, align 4, !tbaa !5
  %345 = load i32, ptr %18, align 4, !tbaa !5
  %346 = icmp eq i32 %344, %345
  br i1 %346, label %347, label %397

347:                                              ; preds = %337
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #8
  %348 = load i32, ptr %18, align 4, !tbaa !5
  %349 = sext i32 %348 to i64
  %350 = getelementptr inbounds [3200001 x i32], ptr @que, i64 0, i64 %349
  %351 = load i32, ptr %350, align 4, !tbaa !5
  store i32 %351, ptr %19, align 4, !tbaa !5
  %352 = load i32, ptr %19, align 4, !tbaa !5
  %353 = load i32, ptr %16, align 4, !tbaa !5
  %354 = icmp sge i32 %352, %353
  br i1 %354, label %355, label %387

355:                                              ; preds = %347
  %356 = load i32, ptr %15, align 4, !tbaa !5
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds [50001 x i32], ptr @ans, i64 0, i64 %357
  %359 = load i32, ptr %358, align 4, !tbaa !5
  %360 = sext i32 %359 to i64
  %361 = load i32, ptr %19, align 4, !tbaa !5
  %362 = sext i32 %361 to i64
  %363 = getelementptr inbounds [50001 x i32], ptr @s, i64 0, i64 %362
  %364 = load i32, ptr %363, align 4, !tbaa !5
  %365 = sext i32 %364 to i64
  %366 = load i32, ptr %19, align 4, !tbaa !5
  %367 = sext i32 %366 to i64
  %368 = getelementptr inbounds [50001 x i32], ptr @fact, i64 0, i64 %367
  %369 = load i32, ptr %368, align 4, !tbaa !5
  %370 = sext i32 %369 to i64
  %371 = mul nsw i64 %365, %370
  %372 = srem i64 %371, 1000000007
  %373 = load i32, ptr %19, align 4, !tbaa !5
  %374 = load i32, ptr %16, align 4, !tbaa !5
  %375 = sub nsw i32 %373, %374
  %376 = sext i32 %375 to i64
  %377 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %376
  %378 = load i32, ptr %377, align 4, !tbaa !5
  %379 = sext i32 %378 to i64
  %380 = mul nsw i64 %372, %379
  %381 = add nsw i64 %360, %380
  %382 = srem i64 %381, 1000000007
  %383 = trunc i64 %382 to i32
  %384 = load i32, ptr %15, align 4, !tbaa !5
  %385 = sext i32 %384 to i64
  %386 = getelementptr inbounds [50001 x i32], ptr @ans, i64 0, i64 %385
  store i32 %383, ptr %386, align 4, !tbaa !5
  br label %387

387:                                              ; preds = %355, %347
  %388 = load i32, ptr %19, align 4, !tbaa !5
  %389 = load i32, ptr %17, align 4, !tbaa !5
  %390 = sext i32 %389 to i64
  %391 = getelementptr inbounds [3200001 x i32], ptr @que, i64 0, i64 %390
  store i32 %388, ptr %391, align 4, !tbaa !5
  %392 = load i32, ptr %17, align 4, !tbaa !5
  %393 = add nsw i32 %392, 1
  store i32 %393, ptr %17, align 4, !tbaa !5
  %394 = load i32, ptr %19, align 4, !tbaa !5
  %395 = sext i32 %394 to i64
  %396 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %395
  store i32 %392, ptr %396, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #8
  br label %397

397:                                              ; preds = %387, %337
  br label %398

398:                                              ; preds = %397
  %399 = load i32, ptr %18, align 4, !tbaa !5
  %400 = add nsw i32 %399, 1
  store i32 %400, ptr %18, align 4, !tbaa !5
  br label %332, !llvm.loop !26

401:                                              ; preds = %336
  %402 = load i32, ptr %17, align 4, !tbaa !5
  store i32 %402, ptr @qtot, align 4, !tbaa !5
  %403 = load i32, ptr %15, align 4, !tbaa !5
  %404 = sext i32 %403 to i64
  %405 = getelementptr inbounds [50001 x i32], ptr @ans, i64 0, i64 %404
  %406 = load i32, ptr %405, align 4, !tbaa !5
  %407 = add nsw i32 %406, 1000000007
  %408 = sext i32 %407 to i64
  %409 = load i32, ptr %16, align 4, !tbaa !5
  %410 = sext i32 %409 to i64
  %411 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %410
  %412 = load i32, ptr %411, align 4, !tbaa !5
  %413 = sext i32 %412 to i64
  %414 = mul nsw i64 %408, %413
  %415 = srem i64 %414, 1000000007
  %416 = trunc i64 %415 to i32
  %417 = load i32, ptr %15, align 4, !tbaa !5
  %418 = sext i32 %417 to i64
  %419 = getelementptr inbounds [50001 x i32], ptr @ans, i64 0, i64 %418
  store i32 %416, ptr %419, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %420

420:                                              ; preds = %401
  %421 = load i32, ptr %12, align 4, !tbaa !5
  %422 = add nsw i32 %421, 1
  store i32 %422, ptr %12, align 4, !tbaa !5
  br label %262, !llvm.loop !27

423:                                              ; preds = %266
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #8
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %424

424:                                              ; preds = %435, %423
  %425 = load i32, ptr %20, align 4, !tbaa !5
  %426 = load i32, ptr @q, align 4, !tbaa !5
  %427 = icmp sle i32 %425, %426
  br i1 %427, label %429, label %428

428:                                              ; preds = %424
  store i32 46, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #8
  br label %438

429:                                              ; preds = %424
  %430 = load i32, ptr %20, align 4, !tbaa !5
  %431 = sext i32 %430 to i64
  %432 = getelementptr inbounds [50001 x i32], ptr @ans, i64 0, i64 %431
  %433 = load i32, ptr %432, align 4, !tbaa !5
  %434 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %433)
  br label %435

435:                                              ; preds = %429
  %436 = load i32, ptr %20, align 4, !tbaa !5
  %437 = add nsw i32 %436, 1
  store i32 %437, ptr %20, align 4, !tbaa !5
  br label %424, !llvm.loop !28

438:                                              ; preds = %428
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %143, !llvm.loop !29

439:                                              ; preds = %143
  ret i32 0
}

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef, ptr noundef, ptr noundef) #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 @_Z3updii(i32 noundef, i32 noundef) #6

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

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


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

%struct.Query = type { i32, i32, i32 }

@fact = external dso_local local_unnamed_addr global [50001 x i32], align 16
@iact = external dso_local local_unnamed_addr global [50001 x i32], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@pr = external dso_local local_unnamed_addr global [100001 x i32], align 16
@d = external dso_local local_unnamed_addr global [100001 x i32], align 16
@idx = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@pp = external dso_local local_unnamed_addr global [7 x i32], align 16
@c = external dso_local local_unnamed_addr global [100001 x i32], align 16
@s = external dso_local local_unnamed_addr global [50001 x i32], align 16
@pos = external dso_local local_unnamed_addr global [50001 x i32], align 16
@qtot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local local_unnamed_addr global [3200001 x i32], align 16
@n = external dso_local global i32, align 4
@q = external dso_local global i32, align 4
@sqn = external dso_local local_unnamed_addr global i32, align 4
@sz = external dso_local local_unnamed_addr global [50001 x i32], align 16
@lpos = external dso_local local_unnamed_addr global [50001 x i32], align 16
@ord = external dso_local global [50001 x i32], align 16
@ans = external dso_local local_unnamed_addr global [50001 x i32], align 16
@query = external dso_local global [50001 x %struct.Query], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite)
declare void @llvm.lifetime.end.p0(i64 immarg, ptr nocapture) #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
  %tot.promoted = load i32, ptr @tot, align 4, !tbaa !5
  br label %4

3:                                                ; preds = %._crit_edge
  store i32 1, ptr getelementptr inbounds (i8, ptr @iact, i64 4), align 4, !tbaa !5
  br label %29

4:                                                ; preds = %0, %._crit_edge
  %indvars.iv174 = phi i64 [ 2, %0 ], [ %indvars.iv.next175, %._crit_edge ]
  %5 = phi i32 [ %tot.promoted, %0 ], [ %13, %._crit_edge ]
  %6 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %indvars.iv174
  %7 = load i32, ptr %6, align 4, !tbaa !5
  %.not107 = icmp eq i32 %7, 0
  %8 = trunc nuw nsw i64 %indvars.iv174 to i32
  br i1 %.not107, label %9, label %._crit_edge204

9:                                                ; preds = %4
  store i32 %8, ptr %6, align 4, !tbaa !5
  %10 = add nsw i32 %5, 1
  store i32 %10, ptr @tot, align 4, !tbaa !5
  %11 = sext i32 %5 to i64
  %12 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %11
  store i32 %8, ptr %12, align 4, !tbaa !5
  br label %._crit_edge204

._crit_edge204:                                   ; preds = %4, %9
  %13 = phi i32 [ %10, %9 ], [ %5, %4 ]
  %14 = load i32, ptr @pr, align 16, !tbaa !5
  %15 = mul nsw i32 %14, %8
  %16 = icmp slt i32 %15, 100001
  br i1 %16, label %.lr.ph, label %._crit_edge

17:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %18 = getelementptr inbounds [100001 x i32], ptr @pr, i64 0, i64 %indvars.iv.next
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %20 = mul nsw i32 %19, %8
  %21 = icmp slt i32 %20, 100001
  br i1 %21, label %.lr.ph, label %._crit_edge, !llvm.loop !9

.lr.ph:                                           ; preds = %._crit_edge204, %17
  %indvars.iv = phi i64 [ %indvars.iv.next, %17 ], [ 0, %._crit_edge204 ]
  %22 = phi i32 [ %20, %17 ], [ %15, %._crit_edge204 ]
  %23 = phi i32 [ %19, %17 ], [ %14, %._crit_edge204 ]
  %24 = sext i32 %22 to i64
  %25 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %24
  store i32 %23, ptr %25, align 4, !tbaa !5
  %26 = load i32, ptr %6, align 4, !tbaa !5
  %27 = icmp eq i32 %26, %23
  br i1 %27, label %._crit_edge, label %17

._crit_edge:                                      ; preds = %17, %.lr.ph, %._crit_edge204
  %indvars.iv.next175 = add nuw nsw i64 %indvars.iv174, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next175, 100001
  br i1 %exitcond.not, label %3, label %4, !llvm.loop !11

28:                                               ; preds = %29
  store i32 1, ptr @iact, align 16, !tbaa !5
  store i32 1, ptr @fact, align 16, !tbaa !5
  br label %45

29:                                               ; preds = %3, %29
  %indvars.iv177 = phi i64 [ 2, %3 ], [ %indvars.iv.next178, %29 ]
  %30 = trunc nuw nsw i64 %indvars.iv177 to i32
  %31 = udiv i32 1000000007, %30
  %32 = zext nneg i32 %31 to i64
  %33 = urem i32 1000000007, %30
  %34 = zext nneg i32 %33 to i64
  %35 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %34
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = mul nsw i64 %37, %32
  %39 = srem i64 %38, 1000000007
  %40 = trunc nsw i64 %39 to i32
  %41 = sub nsw i32 1000000007, %40
  %42 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %indvars.iv177
  store i32 %41, ptr %42, align 4, !tbaa !5
  %indvars.iv.next178 = add nuw nsw i64 %indvars.iv177, 1
  %exitcond180.not = icmp eq i64 %indvars.iv.next178, 50001
  br i1 %exitcond180.not, label %28, label %29, !llvm.loop !12

.preheader111:                                    ; preds = %45
  %43 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %44 = icmp eq i32 %43, 1
  br i1 %44, label %.lr.ph165, label %._crit_edge166

45:                                               ; preds = %28, %45
  %46 = phi i64 [ 1, %28 ], [ %56, %45 ]
  %47 = phi i64 [ 1, %28 ], [ %49, %45 ]
  %indvars.iv181 = phi i64 [ 1, %28 ], [ %indvars.iv.next182, %45 ]
  %48 = mul nsw i64 %47, %indvars.iv181
  %49 = srem i64 %48, 1000000007
  %50 = trunc nsw i64 %49 to i32
  %51 = getelementptr inbounds [50001 x i32], ptr @fact, i64 0, i64 %indvars.iv181
  store i32 %50, ptr %51, align 4, !tbaa !5
  %52 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %indvars.iv181
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = sext i32 %53 to i64
  %55 = mul nsw i64 %46, %54
  %56 = srem i64 %55, 1000000007
  %57 = trunc nsw i64 %56 to i32
  store i32 %57, ptr %52, align 4, !tbaa !5
  %indvars.iv.next182 = add nuw nsw i64 %indvars.iv181, 1
  %exitcond184.not = icmp eq i64 %indvars.iv.next182, 50001
  br i1 %exitcond184.not, label %.preheader111, label %45, !llvm.loop !13

.lr.ph165:                                        ; preds = %.preheader111, %._crit_edge164
  store i32 361, ptr @sqn, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #8
  store i32 0, ptr %1, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #8
  %58 = load i32, ptr @n, align 4, !tbaa !5
  %.not124 = icmp slt i32 %58, 1
  br i1 %.not124, label %._crit_edge128, label %.lr.ph127

._crit_edge128:                                   ; preds = %88, %.lr.ph165
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #8
  %59 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @q)
  %60 = load i32, ptr @q, align 4, !tbaa !5
  %.not101129 = icmp slt i32 %60, 1
  br i1 %.not101129, label %._crit_edge128.._crit_edge133_crit_edge, label %.lr.ph132

._crit_edge128.._crit_edge133_crit_edge:          ; preds = %._crit_edge128
  %.pre205 = sext i32 %60 to i64
  br label %._crit_edge133

.lr.ph127:                                        ; preds = %.lr.ph165, %88
  %indvars.iv188 = phi i64 [ %indvars.iv.next189, %88 ], [ 1, %.lr.ph165 ]
  %61 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %2)
  %62 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %63 = load i32, ptr %62, align 4, !tbaa !5
  store i32 %63, ptr %1, align 4, !tbaa !5
  %.promoted = load i32, ptr %2, align 4, !tbaa !5
  %64 = icmp sgt i32 %.promoted, 1
  br i1 %64, label %.lr.ph122, label %77

.lr.ph122:                                        ; preds = %.lr.ph127, %74
  %indvars.iv185 = phi i64 [ %indvars.iv.next186, %74 ], [ 0, %.lr.ph127 ]
  %storemerge106.lcssa118119 = phi i32 [ %storemerge106, %74 ], [ %.promoted, %.lr.ph127 ]
  %65 = zext nneg i32 %storemerge106.lcssa118119 to i64
  %66 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %65
  %67 = load i32, ptr %66, align 4, !tbaa !5
  %68 = getelementptr inbounds [7 x i32], ptr @pp, i64 0, i64 %indvars.iv185
  store i32 %67, ptr %68, align 4, !tbaa !5
  br label %69

69:                                               ; preds = %69, %.lr.ph122
  %.pn = phi i32 [ %storemerge106.lcssa118119, %.lr.ph122 ], [ %storemerge106, %69 ]
  %storemerge106 = sdiv i32 %.pn, %67
  %70 = sext i32 %storemerge106 to i64
  %71 = getelementptr inbounds [100001 x i32], ptr @d, i64 0, i64 %70
  %72 = load i32, ptr %71, align 4, !tbaa !5
  %73 = icmp eq i32 %72, %67
  br i1 %73, label %69, label %74, !llvm.loop !14

74:                                               ; preds = %69
  %indvars.iv.next186 = add nuw nsw i64 %indvars.iv185, 1
  %75 = icmp sgt i32 %storemerge106, 1
  br i1 %75, label %.lr.ph122, label %._crit_edge123, !llvm.loop !15

._crit_edge123:                                   ; preds = %74
  %76 = trunc nuw i64 %indvars.iv.next186 to i32
  store i32 %storemerge106, ptr %2, align 4, !tbaa !5
  br label %77

77:                                               ; preds = %._crit_edge123, %.lr.ph127
  %storemerge.lcssa = phi i32 [ %76, %._crit_edge123 ], [ 0, %.lr.ph127 ]
  store i32 %storemerge.lcssa, ptr @cnt, align 4, !tbaa !5
  %78 = trunc nuw nsw i64 %indvars.iv188 to i32
  store i32 %78, ptr @idx, align 4, !tbaa !5
  %79 = getelementptr inbounds [50001 x i32], ptr @sz, i64 0, i64 %indvars.iv188
  store i32 0, ptr %79, align 4, !tbaa !5
  call void @_Z3dfsiii(i32 noundef 0, i32 noundef 1, i32 noundef 1)
  %80 = load i32, ptr @sqn, align 4, !tbaa !5
  %81 = sext i32 %80 to i64
  %.not105 = icmp sgt i64 %indvars.iv188, %81
  br i1 %.not105, label %82, label %88

82:                                               ; preds = %77
  %83 = sub nsw i32 %78, %80
  %84 = sext i32 %83 to i64
  %85 = getelementptr inbounds [50001 x i32], ptr @lpos, i64 0, i64 %84
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  br label %88

88:                                               ; preds = %77, %82
  %89 = phi i32 [ %87, %82 ], [ 1, %77 ]
  %90 = getelementptr inbounds [50001 x i32], ptr @lpos, i64 0, i64 %indvars.iv188
  store i32 %89, ptr %90, align 4, !tbaa !5
  %indvars.iv.next189 = add nuw nsw i64 %indvars.iv188, 1
  %91 = load i32, ptr @n, align 4, !tbaa !5
  %92 = sext i32 %91 to i64
  %.not.not = icmp slt i64 %indvars.iv188, %92
  br i1 %.not.not, label %.lr.ph127, label %._crit_edge128, !llvm.loop !16

._crit_edge133:                                   ; preds = %.lr.ph132, %._crit_edge128.._crit_edge133_crit_edge
  %.pre-phi206 = phi i64 [ %.pre205, %._crit_edge128.._crit_edge133_crit_edge ], [ %107, %.lr.ph132 ]
  %gep = getelementptr i32, ptr getelementptr inbounds (i8, ptr @ord, i64 4), i64 %.pre-phi206
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @ord, i64 4), ptr noundef nonnull %gep, ptr noundef nonnull @_Z3cmpRKiS0_)
  %93 = load i32, ptr %1, align 4, !tbaa !5
  %94 = sext i32 %93 to i64
  %95 = shl nsw i64 %94, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @c, i64 4), i8 0, i64 %95, i1 false)
  %96 = load i32, ptr @n, align 4, !tbaa !5
  %97 = sext i32 %96 to i64
  %98 = shl nsw i64 %97, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @s, i64 4), i8 0, i64 %98, i1 false)
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @pos, i64 4), i8 -1, i64 %98, i1 false)
  store i32 0, ptr @qtot, align 4, !tbaa !5
  %99 = load i32, ptr @q, align 4, !tbaa !5
  %.not102155 = icmp slt i32 %99, 1
  br i1 %.not102155, label %._crit_edge164, label %.lr.ph160

.lr.ph132:                                        ; preds = %._crit_edge128, %.lr.ph132
  %indvars.iv191 = phi i64 [ %indvars.iv.next192, %.lr.ph132 ], [ 1, %._crit_edge128 ]
  %100 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %indvars.iv191
  %101 = getelementptr inbounds i8, ptr %100, i64 4
  %102 = getelementptr inbounds i8, ptr %100, i64 8
  %103 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %100, ptr noundef nonnull %101, ptr noundef nonnull %102)
  %104 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %indvars.iv191
  %105 = trunc nuw nsw i64 %indvars.iv191 to i32
  store i32 %105, ptr %104, align 4, !tbaa !5
  %indvars.iv.next192 = add nuw nsw i64 %indvars.iv191, 1
  %106 = load i32, ptr @q, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %.not101.not = icmp slt i64 %indvars.iv191, %107
  br i1 %.not101.not, label %.lr.ph132, label %._crit_edge133, !llvm.loop !17

.preheader110:                                    ; preds = %._crit_edge153
  %.not103161 = icmp slt i32 %148, 1
  br i1 %.not103161, label %._crit_edge164, label %.lr.ph163

.lr.ph160:                                        ; preds = %._crit_edge133, %._crit_edge153
  %indvars.iv198 = phi i64 [ %indvars.iv.next199, %._crit_edge153 ], [ 1, %._crit_edge133 ]
  %.084158 = phi i32 [ %.2.lcssa, %._crit_edge153 ], [ 0, %._crit_edge133 ]
  %.086157 = phi i32 [ %.288.lcssa, %._crit_edge153 ], [ 1, %._crit_edge133 ]
  %108 = getelementptr inbounds [50001 x i32], ptr @ord, i64 0, i64 %indvars.iv198
  %109 = load i32, ptr %108, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [50001 x %struct.Query], ptr @query, i64 0, i64 %110
  %112 = getelementptr inbounds i8, ptr %111, i64 8
  %113 = load i32, ptr %112, align 4, !tbaa !18
  %114 = load i32, ptr %111, align 4, !tbaa !20
  %115 = icmp sgt i32 %.086157, %114
  br i1 %115, label %.lr.ph137, label %.preheader109

.preheader109:                                    ; preds = %.lr.ph137, %.lr.ph160
  %.187.lcssa = phi i32 [ %.086157, %.lr.ph160 ], [ %119, %.lr.ph137 ]
  %116 = getelementptr inbounds i8, ptr %111, i64 4
  %117 = load i32, ptr %116, align 4, !tbaa !21
  %118 = icmp slt i32 %.084158, %117
  br i1 %118, label %.lr.ph140, label %.preheader108

.lr.ph137:                                        ; preds = %.lr.ph160, %.lr.ph137
  %.187135 = phi i32 [ %119, %.lr.ph137 ], [ %.086157, %.lr.ph160 ]
  %119 = add nsw i32 %.187135, -1
  call void @_Z3updii(i32 noundef %119, i32 noundef 1)
  %120 = load i32, ptr %111, align 4, !tbaa !20
  %121 = icmp sgt i32 %119, %120
  br i1 %121, label %.lr.ph137, label %.preheader109, !llvm.loop !22

.preheader108:                                    ; preds = %.lr.ph140, %.preheader109
  %122 = phi i32 [ %117, %.preheader109 ], [ %125, %.lr.ph140 ]
  %.185.lcssa = phi i32 [ %.084158, %.preheader109 ], [ %124, %.lr.ph140 ]
  %123 = icmp sgt i32 %.185.lcssa, %122
  br i1 %123, label %.lr.ph143, label %.preheader

.lr.ph140:                                        ; preds = %.preheader109, %.lr.ph140
  %.185139 = phi i32 [ %124, %.lr.ph140 ], [ %.084158, %.preheader109 ]
  %124 = add nsw i32 %.185139, 1
  call void @_Z3updii(i32 noundef %124, i32 noundef 1)
  %125 = load i32, ptr %116, align 4, !tbaa !21
  %126 = icmp slt i32 %124, %125
  br i1 %126, label %.lr.ph140, label %.preheader108, !llvm.loop !23

.preheader:                                       ; preds = %.lr.ph143, %.preheader108
  %.2.lcssa = phi i32 [ %.185.lcssa, %.preheader108 ], [ %129, %.lr.ph143 ]
  %127 = load i32, ptr %111, align 4, !tbaa !20
  %128 = icmp slt i32 %.187.lcssa, %127
  br i1 %128, label %.lr.ph146, label %._crit_edge147

.lr.ph143:                                        ; preds = %.preheader108, %.lr.ph143
  %.2142 = phi i32 [ %129, %.lr.ph143 ], [ %.185.lcssa, %.preheader108 ]
  %129 = add nsw i32 %.2142, -1
  call void @_Z3updii(i32 noundef %.2142, i32 noundef -1)
  %130 = load i32, ptr %116, align 4, !tbaa !21
  %131 = icmp sgt i32 %129, %130
  br i1 %131, label %.lr.ph143, label %.preheader, !llvm.loop !24

.lr.ph146:                                        ; preds = %.preheader, %.lr.ph146
  %.288145 = phi i32 [ %132, %.lr.ph146 ], [ %.187.lcssa, %.preheader ]
  %132 = add nsw i32 %.288145, 1
  call void @_Z3updii(i32 noundef %.288145, i32 noundef -1)
  %133 = load i32, ptr %111, align 4, !tbaa !20
  %134 = icmp slt i32 %132, %133
  br i1 %134, label %.lr.ph146, label %._crit_edge147, !llvm.loop !25

._crit_edge147:                                   ; preds = %.lr.ph146, %.preheader
  %.288.lcssa = phi i32 [ %.187.lcssa, %.preheader ], [ %132, %.lr.ph146 ]
  %135 = getelementptr inbounds [50001 x i32], ptr @ans, i64 0, i64 %110
  %136 = load i32, ptr @qtot, align 4, !tbaa !5
  %137 = icmp sgt i32 %136, 0
  br i1 %137, label %.lr.ph152.preheader, label %._crit_edge153

.lr.ph152.preheader:                              ; preds = %._crit_edge147
  %wide.trip.count = zext nneg i32 %136 to i64
  br label %.lr.ph152

._crit_edge153:                                   ; preds = %183, %._crit_edge147
  %138 = phi i32 [ 0, %._crit_edge147 ], [ %184, %183 ]
  %.082.lcssa = phi i32 [ 0, %._crit_edge147 ], [ %.1, %183 ]
  store i32 %.082.lcssa, ptr @qtot, align 4, !tbaa !5
  %139 = add nsw i32 %138, 1000000007
  %140 = zext nneg i32 %139 to i64
  %141 = sext i32 %113 to i64
  %142 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = mul nsw i64 %140, %144
  %146 = srem i64 %145, 1000000007
  %147 = trunc nsw i64 %146 to i32
  store i32 %147, ptr %135, align 4, !tbaa !5
  %indvars.iv.next199 = add nuw nsw i64 %indvars.iv198, 1
  %148 = load i32, ptr @q, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %.not102.not = icmp slt i64 %indvars.iv198, %149
  br i1 %.not102.not, label %.lr.ph160, label %.preheader110, !llvm.loop !26

.lr.ph152:                                        ; preds = %.lr.ph152.preheader, %183
  %150 = phi i32 [ 0, %.lr.ph152.preheader ], [ %184, %183 ]
  %indvars.iv194 = phi i64 [ 0, %.lr.ph152.preheader ], [ %indvars.iv.next195, %183 ]
  %.082149 = phi i32 [ 0, %.lr.ph152.preheader ], [ %.1, %183 ]
  %151 = getelementptr inbounds [3200001 x i32], ptr @que, i64 0, i64 %indvars.iv194
  %152 = load i32, ptr %151, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [50001 x i32], ptr @pos, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = zext i32 %155 to i64
  %157 = icmp eq i64 %indvars.iv194, %156
  br i1 %157, label %158, label %183

158:                                              ; preds = %.lr.ph152
  %.not104 = icmp slt i32 %152, %113
  br i1 %.not104, label %178, label %159

159:                                              ; preds = %158
  %160 = sext i32 %150 to i64
  %161 = getelementptr inbounds [50001 x i32], ptr @s, i64 0, i64 %153
  %162 = load i32, ptr %161, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [50001 x i32], ptr @fact, i64 0, i64 %153
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = mul nsw i64 %166, %163
  %168 = srem i64 %167, 1000000007
  %169 = sub nsw i32 %152, %113
  %170 = sext i32 %169 to i64
  %171 = getelementptr inbounds [50001 x i32], ptr @iact, i64 0, i64 %170
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = mul nsw i64 %168, %173
  %175 = add nsw i64 %174, %160
  %176 = srem i64 %175, 1000000007
  %177 = trunc nsw i64 %176 to i32
  store i32 %177, ptr %135, align 4, !tbaa !5
  br label %178

178:                                              ; preds = %159, %158
  %179 = phi i32 [ %177, %159 ], [ %150, %158 ]
  %180 = sext i32 %.082149 to i64
  %181 = getelementptr inbounds [3200001 x i32], ptr @que, i64 0, i64 %180
  store i32 %152, ptr %181, align 4, !tbaa !5
  %182 = add nsw i32 %.082149, 1
  store i32 %.082149, ptr %154, align 4, !tbaa !5
  br label %183

183:                                              ; preds = %.lr.ph152, %178
  %184 = phi i32 [ %179, %178 ], [ %150, %.lr.ph152 ]
  %.1 = phi i32 [ %182, %178 ], [ %.082149, %.lr.ph152 ]
  %indvars.iv.next195 = add nuw nsw i64 %indvars.iv194, 1
  %exitcond197.not = icmp eq i64 %indvars.iv.next195, %wide.trip.count
  br i1 %exitcond197.not, label %._crit_edge153, label %.lr.ph152, !llvm.loop !27

._crit_edge164:                                   ; preds = %.lr.ph163, %._crit_edge133, %.preheader110
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #8
  %185 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %186 = icmp eq i32 %185, 1
  br i1 %186, label %.lr.ph165, label %._crit_edge166, !llvm.loop !28

.lr.ph163:                                        ; preds = %.preheader110, %.lr.ph163
  %indvars.iv201 = phi i64 [ %indvars.iv.next202, %.lr.ph163 ], [ 1, %.preheader110 ]
  %187 = getelementptr inbounds [50001 x i32], ptr @ans, i64 0, i64 %indvars.iv201
  %188 = load i32, ptr %187, align 4, !tbaa !5
  %189 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %188)
  %indvars.iv.next202 = add nuw nsw i64 %indvars.iv201, 1
  %190 = load i32, ptr @q, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %.not103.not = icmp slt i64 %indvars.iv201, %191
  br i1 %.not103.not, label %.lr.ph163, label %._crit_edge164, !llvm.loop !29

._crit_edge166:                                   ; preds = %._crit_edge164, %.preheader111
  ret i32 0
}

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

; 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 #5

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

; Function Attrs: mustprogress 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 @_Z3updii(i32 noundef, i32 noundef) local_unnamed_addr #6

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

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


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