; LLVM IR from tangjz/acm-icpc :: codeforces/complete (856E)

; 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 }
%struct.Fraction = type { i64, i64 }

@rad = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@totL = external dso_local global i32, align 4
@totR = external dso_local global i32, align 4
@que = external dso_local global [500001 x %struct.Query], align 16
@pL = external dso_local global [500001 x %struct.Fraction], align 16
@pR = external dso_local global [500001 x %struct.Fraction], align 16
@seqL = external dso_local global [500001 x %struct.Fraction], align 16
@seqR = external dso_local global [500001 x %struct.Fraction], align 16
@cnt = external dso_local global i32, align 4
@idx = external dso_local global [500001 x i32], align 16
@ord = external dso_local global [500001 x i32], align 16
@pos = external dso_local global [500001 x i32], align 16
@seg = external dso_local global [1000003 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3vis = external hidden global [500001 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i32 @_Z7seg_queiiii(i32 noundef, i32 noundef, i32 noundef, i32 noundef) #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)) #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 ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca i64, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %struct.Fraction, align 8
  %11 = alloca %struct.Fraction, align 8
  %12 = alloca i32, align 4
  %13 = alloca ptr, align 8
  %14 = alloca ptr, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %struct.Fraction, align 8
  %19 = alloca %struct.Fraction, align 8
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca ptr, align 8
  %23 = alloca ptr, align 8
  %24 = alloca ptr, align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca %struct.Query, align 4
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @rad, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #10
  store i32 1, ptr %2, align 4, !tbaa !5
  br label %31

31:                                               ; preds = %116, %0
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr @n, align 4, !tbaa !5
  %34 = icmp sle i32 %32, %33
  br i1 %34, label %36, label %35

35:                                               ; preds = %31
  store i32 2, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #10
  br label %119

36:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 8, ptr %4) #10
  %37 = load i32, ptr %2, align 4, !tbaa !5
  %38 = sext i32 %37 to i64
  %39 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %38
  %40 = getelementptr inbounds %struct.Query, ptr %39, i32 0, i32 0
  store ptr %40, ptr %4, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %5) #10
  %41 = load i32, ptr %2, align 4, !tbaa !5
  %42 = sext i32 %41 to i64
  %43 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %42
  %44 = getelementptr inbounds %struct.Query, ptr %43, i32 0, i32 1
  store ptr %44, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #10
  %45 = load i32, ptr %2, align 4, !tbaa !5
  %46 = sext i32 %45 to i64
  %47 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %46
  %48 = getelementptr inbounds %struct.Query, ptr %47, i32 0, i32 2
  store ptr %48, ptr %6, align 8, !tbaa !9
  %49 = load ptr, ptr %4, align 8, !tbaa !9
  %50 = load ptr, ptr %5, align 8, !tbaa !9
  %51 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %49, ptr noundef %50)
  %52 = load ptr, ptr %4, align 8, !tbaa !9
  %53 = load i32, ptr %52, align 4, !tbaa !5
  %54 = icmp ne i32 %53, 2
  br i1 %54, label %55, label %58

55:                                               ; preds = %36
  %56 = load ptr, ptr %6, align 8, !tbaa !9
  %57 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.5, ptr noundef %56)
  br label %58

58:                                               ; preds = %55, %36
  %59 = load ptr, ptr %4, align 8, !tbaa !9
  %60 = load i32, ptr %59, align 4, !tbaa !5
  %61 = icmp ne i32 %60, 1
  br i1 %61, label %62, label %63

62:                                               ; preds = %58
  store i32 4, ptr %3, align 4
  br label %113

63:                                               ; preds = %58
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #10
  %64 = load i32, ptr @rad, align 4, !tbaa !5
  %65 = load ptr, ptr %5, align 8, !tbaa !9
  %66 = load i32, ptr %65, align 4, !tbaa !5
  %67 = add nsw i32 %64, %66
  %68 = call noundef i64 @_Z3sqri(i32 noundef %67)
  store i64 %68, ptr %7, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #10
  %69 = load i32, ptr @rad, align 4, !tbaa !5
  %70 = load ptr, ptr %5, align 8, !tbaa !9
  %71 = load i32, ptr %70, align 4, !tbaa !5
  %72 = sub nsw i32 %69, %71
  %73 = call noundef i64 @_Z3sqri(i32 noundef %72)
  store i64 %73, ptr %8, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #10
  %74 = load ptr, ptr %6, align 8, !tbaa !9
  %75 = load i32, ptr %74, align 4, !tbaa !5
  %76 = call noundef i64 @_Z3sqri(i32 noundef %75)
  store i64 %76, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 16, ptr %10) #10
  %77 = load i32, ptr @rad, align 4, !tbaa !5
  %78 = load ptr, ptr %5, align 8, !tbaa !9
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %80 = add nsw i32 %77, %79
  %81 = call noundef i32 @_Z3sgni(i32 noundef %80)
  %82 = sext i32 %81 to i64
  %83 = load i64, ptr %7, align 8, !tbaa !11
  %84 = mul nsw i64 %82, %83
  %85 = load i64, ptr %7, align 8, !tbaa !11
  %86 = load i64, ptr %9, align 8, !tbaa !11
  %87 = add nsw i64 %85, %86
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %10, i64 noundef %84, i64 noundef %87)
  %88 = load i32, ptr %2, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pL, i64 0, i64 %89
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %90, ptr align 8 %10, i64 16, i1 false), !tbaa.struct !13
  %91 = load i32, ptr @totL, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr @totL, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = getelementptr inbounds [500001 x %struct.Fraction], ptr @seqL, i64 0, i64 %93
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %94, ptr align 8 %90, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %10) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #10
  %95 = load i32, ptr @rad, align 4, !tbaa !5
  %96 = load ptr, ptr %5, align 8, !tbaa !9
  %97 = load i32, ptr %96, align 4, !tbaa !5
  %98 = sub nsw i32 %95, %97
  %99 = call noundef i32 @_Z3sgni(i32 noundef %98)
  %100 = sext i32 %99 to i64
  %101 = load i64, ptr %8, align 8, !tbaa !11
  %102 = mul nsw i64 %100, %101
  %103 = load i64, ptr %8, align 8, !tbaa !11
  %104 = load i64, ptr %9, align 8, !tbaa !11
  %105 = add nsw i64 %103, %104
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %11, i64 noundef %102, i64 noundef %105)
  %106 = load i32, ptr %2, align 4, !tbaa !5
  %107 = sext i32 %106 to i64
  %108 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pR, i64 0, i64 %107
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %108, ptr align 8 %11, i64 16, i1 false), !tbaa.struct !13
  %109 = load i32, ptr @totR, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr @totR, align 4, !tbaa !5
  %111 = sext i32 %110 to i64
  %112 = getelementptr inbounds [500001 x %struct.Fraction], ptr @seqR, i64 0, i64 %111
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %112, ptr align 8 %108, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #10
  store i32 0, ptr %3, align 4
  br label %113

113:                                              ; preds = %63, %62
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %5) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %4) #10
  %114 = load i32, ptr %3, align 4
  switch i32 %114, label %503 [
    i32 0, label %115
    i32 4, label %116
  ]

115:                                              ; preds = %113
  br label %116

116:                                              ; preds = %115, %113
  %117 = load i32, ptr %2, align 4, !tbaa !5
  %118 = add nsw i32 %117, 1
  store i32 %118, ptr %2, align 4, !tbaa !5
  br label %31, !llvm.loop !14

119:                                              ; preds = %35
  %120 = load i32, ptr @totL, align 4, !tbaa !5
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds %struct.Fraction, ptr @seqL, i64 %121
  %123 = getelementptr inbounds %struct.Fraction, ptr %122, i64 1
  call void @_ZSt4sortIP8FractionEvT_S2_(ptr noundef getelementptr inbounds (%struct.Fraction, ptr @seqL, i64 1), ptr noundef %123)
  %124 = load i32, ptr @totL, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds %struct.Fraction, ptr @seqL, i64 %125
  %127 = getelementptr inbounds %struct.Fraction, ptr %126, i64 1
  %128 = call noundef ptr @_ZSt6uniqueIP8FractionET_S2_S2_(ptr noundef getelementptr inbounds (%struct.Fraction, ptr @seqL, i64 1), ptr noundef %127)
  %129 = ptrtoint ptr %128 to i64
  %130 = sub i64 %129, ptrtoint (ptr @seqL to i64)
  %131 = sdiv exact i64 %130, 16
  %132 = sub nsw i64 %131, 1
  %133 = trunc i64 %132 to i32
  store i32 %133, ptr @totL, align 4, !tbaa !5
  %134 = load i32, ptr @totR, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = getelementptr inbounds %struct.Fraction, ptr @seqR, i64 %135
  %137 = getelementptr inbounds %struct.Fraction, ptr %136, i64 1
  call void @_ZSt4sortIP8FractionEvT_S2_(ptr noundef getelementptr inbounds (%struct.Fraction, ptr @seqR, i64 1), ptr noundef %137)
  %138 = load i32, ptr @totR, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds %struct.Fraction, ptr @seqR, i64 %139
  %141 = getelementptr inbounds %struct.Fraction, ptr %140, i64 1
  %142 = call noundef ptr @_ZSt6uniqueIP8FractionET_S2_S2_(ptr noundef getelementptr inbounds (%struct.Fraction, ptr @seqR, i64 1), ptr noundef %141)
  %143 = ptrtoint ptr %142 to i64
  %144 = sub i64 %143, ptrtoint (ptr @seqR to i64)
  %145 = sdiv exact i64 %144, 16
  %146 = sub nsw i64 %145, 1
  %147 = trunc i64 %146 to i32
  store i32 %147, ptr @totR, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #10
  store i32 1, ptr %12, align 4, !tbaa !5
  br label %148

148:                                              ; preds = %257, %119
  %149 = load i32, ptr %12, align 4, !tbaa !5
  %150 = load i32, ptr @n, align 4, !tbaa !5
  %151 = icmp sle i32 %149, %150
  br i1 %151, label %153, label %152

152:                                              ; preds = %148
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #10
  br label %260

153:                                              ; preds = %148
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #10
  %154 = load i32, ptr %12, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %155
  %157 = getelementptr inbounds %struct.Query, ptr %156, i32 0, i32 0
  store ptr %157, ptr %13, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #10
  %158 = load i32, ptr %12, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %159
  %161 = getelementptr inbounds %struct.Query, ptr %160, i32 0, i32 1
  store ptr %161, ptr %14, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %15) #10
  %162 = load i32, ptr %12, align 4, !tbaa !5
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %163
  %165 = getelementptr inbounds %struct.Query, ptr %164, i32 0, i32 2
  store ptr %165, ptr %15, align 8, !tbaa !9
  %166 = load ptr, ptr %13, align 8, !tbaa !9
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = icmp eq i32 %167, 1
  br i1 %168, label %169, label %256

169:                                              ; preds = %153
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #10
  %170 = load ptr, ptr %14, align 8, !tbaa !9
  %171 = load i32, ptr %170, align 4, !tbaa !5
  store i32 %171, ptr %16, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #10
  %172 = load ptr, ptr %15, align 8, !tbaa !9
  %173 = load i32, ptr %172, align 4, !tbaa !5
  store i32 %173, ptr %17, align 4, !tbaa !5
  %174 = load i32, ptr @totL, align 4, !tbaa !5
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds %struct.Fraction, ptr @seqL, i64 %175
  %177 = getelementptr inbounds %struct.Fraction, ptr %176, i64 1
  %178 = load i32, ptr %12, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pL, i64 0, i64 %179
  %181 = call noundef ptr @_ZSt11lower_boundIP8FractionS0_ET_S2_S2_RKT0_(ptr noundef getelementptr inbounds (%struct.Fraction, ptr @seqL, i64 1), ptr noundef %177, ptr noundef nonnull align 8 dereferenceable(16) %180)
  %182 = ptrtoint ptr %181 to i64
  %183 = sub i64 %182, ptrtoint (ptr @seqL to i64)
  %184 = sdiv exact i64 %183, 16
  %185 = trunc i64 %184 to i32
  %186 = load ptr, ptr %14, align 8, !tbaa !9
  store i32 %185, ptr %186, align 4, !tbaa !5
  %187 = load i32, ptr @totR, align 4, !tbaa !5
  %188 = sext i32 %187 to i64
  %189 = getelementptr inbounds %struct.Fraction, ptr @seqR, i64 %188
  %190 = getelementptr inbounds %struct.Fraction, ptr %189, i64 1
  %191 = load i32, ptr %12, align 4, !tbaa !5
  %192 = sext i32 %191 to i64
  %193 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pR, i64 0, i64 %192
  %194 = call noundef ptr @_ZSt11lower_boundIP8FractionS0_ET_S2_S2_RKT0_(ptr noundef getelementptr inbounds (%struct.Fraction, ptr @seqR, i64 1), ptr noundef %190, ptr noundef nonnull align 8 dereferenceable(16) %193)
  %195 = ptrtoint ptr %194 to i64
  %196 = sub i64 %195, ptrtoint (ptr @seqR to i64)
  %197 = sdiv exact i64 %196, 16
  %198 = trunc i64 %197 to i32
  %199 = load ptr, ptr %15, align 8, !tbaa !9
  store i32 %198, ptr %199, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %18) #10
  %200 = load i32, ptr %16, align 4, !tbaa !5
  %201 = load i32, ptr @rad, align 4, !tbaa !5
  %202 = sub nsw i32 0, %201
  %203 = icmp sge i32 %200, %202
  br i1 %203, label %204, label %219

204:                                              ; preds = %169
  %205 = load i32, ptr %16, align 4, !tbaa !5
  %206 = load i32, ptr @rad, align 4, !tbaa !5
  %207 = add nsw i32 %205, %206
  %208 = call noundef i64 @_Z3sqri(i32 noundef %207)
  %209 = load i32, ptr %17, align 4, !tbaa !5
  %210 = call noundef i64 @_Z3sqri(i32 noundef %209)
  %211 = sub nsw i64 %208, %210
  %212 = load i32, ptr %16, align 4, !tbaa !5
  %213 = load i32, ptr @rad, align 4, !tbaa !5
  %214 = add nsw i32 %212, %213
  %215 = call noundef i64 @_Z3sqri(i32 noundef %214)
  %216 = load i32, ptr %17, align 4, !tbaa !5
  %217 = call noundef i64 @_Z3sqri(i32 noundef %216)
  %218 = add nsw i64 %215, %217
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef %211, i64 noundef %218)
  br label %220

219:                                              ; preds = %169
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %18, i64 noundef -1, i64 noundef 1)
  br label %220

220:                                              ; preds = %219, %204
  %221 = load i32, ptr %12, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pL, i64 0, i64 %222
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %223, ptr align 8 %18, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %18) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #10
  %224 = load i32, ptr %16, align 4, !tbaa !5
  %225 = load i32, ptr @rad, align 4, !tbaa !5
  %226 = icmp sle i32 %224, %225
  br i1 %226, label %227, label %242

227:                                              ; preds = %220
  %228 = load i32, ptr %17, align 4, !tbaa !5
  %229 = call noundef i64 @_Z3sqri(i32 noundef %228)
  %230 = load i32, ptr %16, align 4, !tbaa !5
  %231 = load i32, ptr @rad, align 4, !tbaa !5
  %232 = sub nsw i32 %230, %231
  %233 = call noundef i64 @_Z3sqri(i32 noundef %232)
  %234 = sub nsw i64 %229, %233
  %235 = load i32, ptr %16, align 4, !tbaa !5
  %236 = load i32, ptr @rad, align 4, !tbaa !5
  %237 = sub nsw i32 %235, %236
  %238 = call noundef i64 @_Z3sqri(i32 noundef %237)
  %239 = load i32, ptr %17, align 4, !tbaa !5
  %240 = call noundef i64 @_Z3sqri(i32 noundef %239)
  %241 = add nsw i64 %238, %240
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %19, i64 noundef %234, i64 noundef %241)
  br label %243

242:                                              ; preds = %220
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %19, i64 noundef 1, i64 noundef 1)
  br label %243

243:                                              ; preds = %242, %227
  %244 = load i32, ptr %12, align 4, !tbaa !5
  %245 = sext i32 %244 to i64
  %246 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pR, i64 0, i64 %245
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 %246, ptr align 8 %19, i64 16, i1 false), !tbaa.struct !13
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #10
  %247 = load i32, ptr %12, align 4, !tbaa !5
  %248 = load i32, ptr @cnt, align 4, !tbaa !5
  %249 = add nsw i32 %248, 1
  store i32 %249, ptr @cnt, align 4, !tbaa !5
  %250 = sext i32 %249 to i64
  %251 = getelementptr inbounds [500001 x i32], ptr @ord, i64 0, i64 %250
  store i32 %247, ptr %251, align 4, !tbaa !5
  %252 = load i32, ptr %12, align 4, !tbaa !5
  %253 = load i32, ptr @cnt, align 4, !tbaa !5
  %254 = sext i32 %253 to i64
  %255 = getelementptr inbounds [500001 x i32], ptr @idx, i64 0, i64 %254
  store i32 %252, ptr %255, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #10
  br label %256

256:                                              ; preds = %243, %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %15) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #10
  br label %257

257:                                              ; preds = %256
  %258 = load i32, ptr %12, align 4, !tbaa !5
  %259 = add nsw i32 %258, 1
  store i32 %259, ptr %12, align 4, !tbaa !5
  br label %148, !llvm.loop !16

260:                                              ; preds = %152
  %261 = load i32, ptr @cnt, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds i32, ptr @ord, i64 %262
  %264 = getelementptr inbounds i32, ptr %263, i64 1
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef getelementptr inbounds (i32, ptr @ord, i64 1), ptr noundef %264, ptr noundef @_Z3cmpRKiS0_)
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #10
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %265

265:                                              ; preds = %278, %260
  %266 = load i32, ptr %20, align 4, !tbaa !5
  %267 = load i32, ptr @cnt, align 4, !tbaa !5
  %268 = icmp sle i32 %266, %267
  br i1 %268, label %270, label %269

269:                                              ; preds = %265
  store i32 8, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #10
  br label %281

270:                                              ; preds = %265
  %271 = load i32, ptr %20, align 4, !tbaa !5
  %272 = load i32, ptr %20, align 4, !tbaa !5
  %273 = sext i32 %272 to i64
  %274 = getelementptr inbounds [500001 x i32], ptr @ord, i64 0, i64 %273
  %275 = load i32, ptr %274, align 4, !tbaa !5
  %276 = sext i32 %275 to i64
  %277 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %276
  store i32 %271, ptr %277, align 4, !tbaa !5
  br label %278

278:                                              ; preds = %270
  %279 = load i32, ptr %20, align 4, !tbaa !5
  %280 = add nsw i32 %279, 1
  store i32 %280, ptr %20, align 4, !tbaa !5
  br label %265, !llvm.loop !17

281:                                              ; preds = %269
  %282 = load i32, ptr @cnt, align 4, !tbaa !5
  %283 = shl i32 %282, 1
  %284 = sext i32 %283 to i64
  %285 = mul i64 %284, 4
  call void @llvm.memset.p0.i64(ptr align 4 getelementptr inbounds (i32, ptr @seg, i64 1), i8 63, i64 %285, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #10
  store i32 1, ptr %21, align 4, !tbaa !5
  br label %286

286:                                              ; preds = %499, %281
  %287 = load i32, ptr %21, align 4, !tbaa !5
  %288 = load i32, ptr @n, align 4, !tbaa !5
  %289 = icmp sle i32 %287, %288
  br i1 %289, label %291, label %290

290:                                              ; preds = %286
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #10
  br label %502

291:                                              ; preds = %286
  call void @llvm.lifetime.start.p0(i64 8, ptr %22) #10
  %292 = load i32, ptr %21, align 4, !tbaa !5
  %293 = sext i32 %292 to i64
  %294 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %293
  %295 = getelementptr inbounds %struct.Query, ptr %294, i32 0, i32 0
  store ptr %295, ptr %22, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #10
  %296 = load i32, ptr %21, align 4, !tbaa !5
  %297 = sext i32 %296 to i64
  %298 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %297
  %299 = getelementptr inbounds %struct.Query, ptr %298, i32 0, i32 1
  store ptr %299, ptr %23, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #10
  %300 = load i32, ptr %21, align 4, !tbaa !5
  %301 = sext i32 %300 to i64
  %302 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %301
  %303 = getelementptr inbounds %struct.Query, ptr %302, i32 0, i32 2
  store ptr %303, ptr %24, align 8, !tbaa !9
  %304 = load ptr, ptr %22, align 8, !tbaa !9
  %305 = load i32, ptr %304, align 4, !tbaa !5
  %306 = icmp eq i32 %305, 1
  br i1 %306, label %307, label %321

307:                                              ; preds = %291
  %308 = load i32, ptr %21, align 4, !tbaa !5
  %309 = sext i32 %308 to i64
  %310 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %309
  store i8 1, ptr %310, align 1, !tbaa !18
  %311 = load i32, ptr @cnt, align 4, !tbaa !5
  %312 = load i32, ptr %21, align 4, !tbaa !5
  %313 = sext i32 %312 to i64
  %314 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %313
  %315 = load i32, ptr %314, align 4, !tbaa !5
  %316 = load i32, ptr %21, align 4, !tbaa !5
  %317 = sext i32 %316 to i64
  %318 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %317
  %319 = getelementptr inbounds %struct.Query, ptr %318, i32 0, i32 2
  %320 = load i32, ptr %319, align 4, !tbaa !20
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %311, i32 noundef %315, i32 noundef %320)
  br label %495

321:                                              ; preds = %291
  %322 = load ptr, ptr %22, align 8, !tbaa !9
  %323 = load i32, ptr %322, align 4, !tbaa !5
  %324 = icmp eq i32 %323, 2
  br i1 %324, label %325, label %354

325:                                              ; preds = %321
  %326 = load ptr, ptr %23, align 8, !tbaa !9
  %327 = load i32, ptr %326, align 4, !tbaa !5
  %328 = sext i32 %327 to i64
  %329 = getelementptr inbounds [500001 x i32], ptr @idx, i64 0, i64 %328
  %330 = load i32, ptr %329, align 4, !tbaa !5
  %331 = load ptr, ptr %23, align 8, !tbaa !9
  store i32 %330, ptr %331, align 4, !tbaa !5
  %332 = load ptr, ptr %23, align 8, !tbaa !9
  %333 = load i32, ptr %332, align 4, !tbaa !5
  %334 = sext i32 %333 to i64
  %335 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %334
  %336 = load i8, ptr %335, align 1, !tbaa !18, !range !22, !noundef !23
  %337 = trunc i8 %336 to i1
  %338 = zext i1 %337 to i32
  %339 = icmp eq i32 %338, 1
  br i1 %339, label %340, label %341

340:                                              ; preds = %325
  br label %343

341:                                              ; preds = %325
  call void @__assert_fail(ptr noundef @.str.6, ptr noundef @.str.7, i32 noundef 103, ptr noundef @__PRETTY_FUNCTION__.main) #11
  unreachable

342:                                              ; No predecessors!
  br label %343

343:                                              ; preds = %342, %340
  %344 = load i32, ptr @cnt, align 4, !tbaa !5
  %345 = load ptr, ptr %23, align 8, !tbaa !9
  %346 = load i32, ptr %345, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %347
  %349 = load i32, ptr %348, align 4, !tbaa !5
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %344, i32 noundef %349, i32 noundef 1061109567)
  %350 = load ptr, ptr %23, align 8, !tbaa !9
  %351 = load i32, ptr %350, align 4, !tbaa !5
  %352 = sext i32 %351 to i64
  %353 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %352
  store i8 0, ptr %353, align 1, !tbaa !18
  br label %494

354:                                              ; preds = %321
  %355 = load ptr, ptr %23, align 8, !tbaa !9
  %356 = load i32, ptr %355, align 4, !tbaa !5
  %357 = sext i32 %356 to i64
  %358 = getelementptr inbounds [500001 x i32], ptr @idx, i64 0, i64 %357
  %359 = load i32, ptr %358, align 4, !tbaa !5
  %360 = load ptr, ptr %23, align 8, !tbaa !9
  store i32 %359, ptr %360, align 4, !tbaa !5
  %361 = load ptr, ptr %24, align 8, !tbaa !9
  %362 = load i32, ptr %361, align 4, !tbaa !5
  %363 = sext i32 %362 to i64
  %364 = getelementptr inbounds [500001 x i32], ptr @idx, i64 0, i64 %363
  %365 = load i32, ptr %364, align 4, !tbaa !5
  %366 = load ptr, ptr %24, align 8, !tbaa !9
  store i32 %365, ptr %366, align 4, !tbaa !5
  %367 = load ptr, ptr %23, align 8, !tbaa !9
  %368 = load i32, ptr %367, align 4, !tbaa !5
  %369 = sext i32 %368 to i64
  %370 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %369
  %371 = load i8, ptr %370, align 1, !tbaa !18, !range !22, !noundef !23
  %372 = trunc i8 %371 to i1
  %373 = zext i1 %372 to i32
  %374 = icmp eq i32 %373, 1
  br i1 %374, label %375, label %384

375:                                              ; preds = %354
  %376 = load ptr, ptr %24, align 8, !tbaa !9
  %377 = load i32, ptr %376, align 4, !tbaa !5
  %378 = sext i32 %377 to i64
  %379 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %378
  %380 = load i8, ptr %379, align 1, !tbaa !18, !range !22, !noundef !23
  %381 = trunc i8 %380 to i1
  %382 = zext i1 %381 to i32
  %383 = icmp eq i32 %382, 1
  br label %384

384:                                              ; preds = %375, %354
  %385 = phi i1 [ false, %354 ], [ %383, %375 ]
  br i1 %385, label %386, label %387

386:                                              ; preds = %384
  br label %389

387:                                              ; preds = %384
  call void @__assert_fail(ptr noundef @.str.8, ptr noundef @.str.7, i32 noundef 109, ptr noundef @__PRETTY_FUNCTION__.main) #11
  unreachable

388:                                              ; No predecessors!
  br label %389

389:                                              ; preds = %388, %386
  %390 = load ptr, ptr %23, align 8, !tbaa !9
  %391 = load i32, ptr %390, align 4, !tbaa !5
  %392 = sext i32 %391 to i64
  %393 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pR, i64 0, i64 %392
  %394 = load ptr, ptr %24, align 8, !tbaa !9
  %395 = load i32, ptr %394, align 4, !tbaa !5
  %396 = sext i32 %395 to i64
  %397 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pR, i64 0, i64 %396
  %398 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3minI8FractionERKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(16) %393, ptr noundef nonnull align 8 dereferenceable(16) %397)
  %399 = load ptr, ptr %23, align 8, !tbaa !9
  %400 = load i32, ptr %399, align 4, !tbaa !5
  %401 = sext i32 %400 to i64
  %402 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pL, i64 0, i64 %401
  %403 = load ptr, ptr %24, align 8, !tbaa !9
  %404 = load i32, ptr %403, align 4, !tbaa !5
  %405 = sext i32 %404 to i64
  %406 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pL, i64 0, i64 %405
  %407 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3maxI8FractionERKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(16) %402, ptr noundef nonnull align 8 dereferenceable(16) %406)
  %408 = call noundef zeroext i1 @_ZNK8FractionltERKS_(ptr noundef nonnull align 8 dereferenceable(16) %398, ptr noundef nonnull align 8 dereferenceable(16) %407)
  br i1 %408, label %409, label %411

409:                                              ; preds = %389
  %410 = call i32 @puts(ptr noundef @.str.9)
  store i32 13, ptr %3, align 4
  br label %496

411:                                              ; preds = %389
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #10
  %412 = load ptr, ptr %23, align 8, !tbaa !9
  %413 = load i32, ptr %412, align 4, !tbaa !5
  %414 = sext i32 %413 to i64
  %415 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %414
  %416 = getelementptr inbounds %struct.Query, ptr %415, i32 0, i32 1
  %417 = load ptr, ptr %24, align 8, !tbaa !9
  %418 = load i32, ptr %417, align 4, !tbaa !5
  %419 = sext i32 %418 to i64
  %420 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %419
  %421 = getelementptr inbounds %struct.Query, ptr %420, i32 0, i32 1
  %422 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %416, ptr noundef nonnull align 4 dereferenceable(4) %421)
  %423 = load i32, ptr %422, align 4, !tbaa !5
  store i32 %423, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #10
  %424 = load ptr, ptr %23, align 8, !tbaa !9
  %425 = load i32, ptr %424, align 4, !tbaa !5
  %426 = sext i32 %425 to i64
  %427 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %426
  %428 = getelementptr inbounds %struct.Query, ptr %427, i32 0, i32 2
  %429 = load ptr, ptr %24, align 8, !tbaa !9
  %430 = load i32, ptr %429, align 4, !tbaa !5
  %431 = sext i32 %430 to i64
  %432 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %431
  %433 = getelementptr inbounds %struct.Query, ptr %432, i32 0, i32 2
  %434 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %428, ptr noundef nonnull align 4 dereferenceable(4) %433)
  %435 = load i32, ptr %434, align 4, !tbaa !5
  store i32 %435, ptr %26, align 4, !tbaa !5
  %436 = load i32, ptr @cnt, align 4, !tbaa !5
  %437 = load ptr, ptr %23, align 8, !tbaa !9
  %438 = load i32, ptr %437, align 4, !tbaa !5
  %439 = sext i32 %438 to i64
  %440 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %439
  %441 = load i32, ptr %440, align 4, !tbaa !5
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %436, i32 noundef %441, i32 noundef 1061109567)
  %442 = load i32, ptr @cnt, align 4, !tbaa !5
  %443 = load ptr, ptr %24, align 8, !tbaa !9
  %444 = load i32, ptr %443, align 4, !tbaa !5
  %445 = sext i32 %444 to i64
  %446 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %445
  %447 = load i32, ptr %446, align 4, !tbaa !5
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %442, i32 noundef %447, i32 noundef 1061109567)
  call void @llvm.lifetime.start.p0(i64 12, ptr %27) #10
  %448 = getelementptr inbounds %struct.Query, ptr %27, i32 0, i32 0
  store i32 0, ptr %448, align 4, !tbaa !24
  %449 = getelementptr inbounds %struct.Query, ptr %27, i32 0, i32 1
  %450 = load i32, ptr %25, align 4, !tbaa !5
  store i32 %450, ptr %449, align 4, !tbaa !25
  %451 = getelementptr inbounds %struct.Query, ptr %27, i32 0, i32 2
  store i32 0, ptr %451, align 4, !tbaa !20
  call void @llvm.memcpy.p0.p0.i64(ptr align 16 @que, ptr align 4 %27, i64 12, i1 false), !tbaa.struct !26
  call void @llvm.lifetime.end.p0(i64 12, ptr %27) #10
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #10
  %452 = load i32, ptr @cnt, align 4, !tbaa !5
  %453 = sext i32 %452 to i64
  %454 = getelementptr inbounds i32, ptr @ord, i64 %453
  %455 = getelementptr inbounds i32, ptr %454, i64 1
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #10
  store i32 0, ptr %29, align 4, !tbaa !5
  %456 = call noundef ptr @_ZSt11upper_boundIPiiPFbRKiS2_EET_S5_S5_RKT0_T1_(ptr noundef getelementptr inbounds (i32, ptr @ord, i64 1), ptr noundef %455, ptr noundef nonnull align 4 dereferenceable(4) %29, ptr noundef @_Z3cmpRKiS0_)
  %457 = ptrtoint ptr %456 to i64
  %458 = sub i64 %457, ptrtoint (ptr @ord to i64)
  %459 = sdiv exact i64 %458, 4
  %460 = sub nsw i64 %459, 1
  %461 = trunc i64 %460 to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #10
  store i32 %461, ptr %28, align 4, !tbaa !5
  %462 = load i32, ptr @cnt, align 4, !tbaa !5
  %463 = load i32, ptr %28, align 4, !tbaa !5
  %464 = call noundef i32 @_Z7seg_queiiii(i32 noundef 1, i32 noundef %462, i32 noundef 1, i32 noundef %463)
  %465 = load i32, ptr %26, align 4, !tbaa !5
  %466 = icmp sgt i32 %464, %465
  %467 = zext i1 %466 to i64
  %468 = select i1 %466, ptr @.str.10, ptr @.str.9
  %469 = call i32 @puts(ptr noundef %468)
  %470 = load i32, ptr @cnt, align 4, !tbaa !5
  %471 = load ptr, ptr %23, align 8, !tbaa !9
  %472 = load i32, ptr %471, align 4, !tbaa !5
  %473 = sext i32 %472 to i64
  %474 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %473
  %475 = load i32, ptr %474, align 4, !tbaa !5
  %476 = load ptr, ptr %23, align 8, !tbaa !9
  %477 = load i32, ptr %476, align 4, !tbaa !5
  %478 = sext i32 %477 to i64
  %479 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %478
  %480 = getelementptr inbounds %struct.Query, ptr %479, i32 0, i32 2
  %481 = load i32, ptr %480, align 4, !tbaa !20
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %470, i32 noundef %475, i32 noundef %481)
  %482 = load i32, ptr @cnt, align 4, !tbaa !5
  %483 = load ptr, ptr %24, align 8, !tbaa !9
  %484 = load i32, ptr %483, align 4, !tbaa !5
  %485 = sext i32 %484 to i64
  %486 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %485
  %487 = load i32, ptr %486, align 4, !tbaa !5
  %488 = load ptr, ptr %24, align 8, !tbaa !9
  %489 = load i32, ptr %488, align 4, !tbaa !5
  %490 = sext i32 %489 to i64
  %491 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %490
  %492 = getelementptr inbounds %struct.Query, ptr %491, i32 0, i32 2
  %493 = load i32, ptr %492, align 4, !tbaa !20
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %482, i32 noundef %487, i32 noundef %493)
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #10
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #10
  br label %494

494:                                              ; preds = %411, %343
  br label %495

495:                                              ; preds = %494, %307
  store i32 0, ptr %3, align 4
  br label %496

496:                                              ; preds = %495, %409
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #10
  call void @llvm.lifetime.end.p0(i64 8, ptr %22) #10
  %497 = load i32, ptr %3, align 4
  switch i32 %497, label %503 [
    i32 0, label %498
    i32 13, label %499
  ]

498:                                              ; preds = %496
  br label %499

499:                                              ; preds = %498, %496
  %500 = load i32, ptr %21, align 4, !tbaa !5
  %501 = add nsw i32 %500, 1
  store i32 %501, ptr %21, align 4, !tbaa !5
  br label %286, !llvm.loop !27

502:                                              ; preds = %290
  ret i32 0

503:                                              ; preds = %496, %113
  unreachable
}

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i64 @_Z3sqri(i32 noundef) #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgni(i32 noundef) #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) unnamed_addr #0 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIP8FractionS0_ET_S2_S2_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) #7

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #9

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3minI8FractionERKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8FractionltERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3maxI8FractionERKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) #5

declare i32 @puts(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 noundef ptr @_ZSt11upper_boundIPiiPFbRKiS2_EET_S5_S5_RKT0_T1_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef) #7

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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { noreturn 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 #10 = { nounwind }
attributes #11 = { noreturn 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 = !{!10, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = !{!12, !12, i64 0}
!12 = !{!"long long", !7, i64 0}
!13 = !{i64 0, i64 8, !11, i64 8, i64 8, !11}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}
!16 = distinct !{!16, !15}
!17 = distinct !{!17, !15}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!21, !6, i64 8}
!21 = !{!"_ZTS5Query", !6, i64 0, !6, i64 4, !6, i64 8}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = !{!21, !6, i64 0}
!25 = !{!21, !6, i64 4}
!26 = !{i64 0, i64 4, !5, i64 4, i64 4, !5, i64 8, i64 4, !5}
!27 = distinct !{!27, !15}


; 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 }
%struct.Fraction = type { i64, i64 }

@rad = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@totL = external dso_local local_unnamed_addr global i32, align 4
@totR = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [500001 x %struct.Query], align 16
@pL = external dso_local global [500001 x %struct.Fraction], align 16
@pR = external dso_local global [500001 x %struct.Fraction], align 16
@seqL = external dso_local global [500001 x %struct.Fraction], align 16
@seqR = external dso_local global [500001 x %struct.Fraction], align 16
@cnt = external dso_local local_unnamed_addr global i32, align 4
@idx = external dso_local local_unnamed_addr global [500001 x i32], align 16
@ord = external dso_local global [500001 x i32], align 16
@pos = external dso_local local_unnamed_addr global [500001 x i32], align 16
@seg = external dso_local local_unnamed_addr global [1000003 x i32], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [3 x i8], align 1
@_ZZ4mainE3vis = external hidden local_unnamed_addr global [500001 x i8], align 16
@.str.6 = external hidden unnamed_addr constant [12 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [78 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@.str.8 = external hidden unnamed_addr constant [27 x i8], align 1
@.str.9 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.10 = external hidden unnamed_addr constant [4 x i8], align 1

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #3 {
  %1 = alloca %struct.Fraction, align 8
  %2 = alloca %struct.Fraction, align 8
  %3 = alloca %struct.Fraction, align 8
  %4 = alloca %struct.Fraction, align 8
  %5 = alloca i32, align 4
  %6 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @rad, ptr noundef nonnull @n)
  %7 = load i32, ptr @n, align 4, !tbaa !5
  %.not104 = icmp slt i32 %7, 1
  br i1 %.not104, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.thread, %0
  %8 = load i32, ptr @totL, align 4, !tbaa !5
  %9 = sext i32 %8 to i64
  %10 = getelementptr inbounds %struct.Fraction, ptr @seqL, i64 %9
  %11 = getelementptr inbounds i8, ptr %10, i64 16
  call void @_ZSt4sortIP8FractionEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seqL, i64 16), ptr noundef nonnull %11)
  %12 = load i32, ptr @totL, align 4, !tbaa !5
  %13 = sext i32 %12 to i64
  %14 = getelementptr inbounds %struct.Fraction, ptr @seqL, i64 %13
  %15 = getelementptr inbounds i8, ptr %14, i64 16
  %16 = call noundef ptr @_ZSt6uniqueIP8FractionET_S2_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seqL, i64 16), ptr noundef nonnull %15)
  %17 = ptrtoint ptr %16 to i64
  %18 = sub i64 %17, ptrtoint (ptr @seqL to i64)
  %19 = lshr exact i64 %18, 4
  %20 = trunc i64 %19 to i32
  %21 = add i32 %20, -1
  store i32 %21, ptr @totL, align 4, !tbaa !5
  %22 = load i32, ptr @totR, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds %struct.Fraction, ptr @seqR, i64 %23
  %25 = getelementptr inbounds i8, ptr %24, i64 16
  call void @_ZSt4sortIP8FractionEvT_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seqR, i64 16), ptr noundef nonnull %25)
  %26 = load i32, ptr @totR, align 4, !tbaa !5
  %27 = sext i32 %26 to i64
  %28 = getelementptr inbounds %struct.Fraction, ptr @seqR, i64 %27
  %29 = getelementptr inbounds i8, ptr %28, i64 16
  %30 = call noundef ptr @_ZSt6uniqueIP8FractionET_S2_S2_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seqR, i64 16), ptr noundef nonnull %29)
  %31 = ptrtoint ptr %30 to i64
  %32 = sub i64 %31, ptrtoint (ptr @seqR to i64)
  %33 = lshr exact i64 %32, 4
  %34 = trunc i64 %33 to i32
  %35 = add i32 %34, -1
  store i32 %35, ptr @totR, align 4, !tbaa !5
  %36 = load i32, ptr @n, align 4, !tbaa !5
  %.not96107 = icmp slt i32 %36, 1
  br i1 %.not96107, label %._crit_edge111, label %.lr.ph110

.lr.ph:                                           ; preds = %0, %.thread
  %indvars.iv = phi i64 [ %indvars.iv.next, %.thread ], [ 1, %0 ]
  %37 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %indvars.iv
  %38 = getelementptr inbounds i8, ptr %37, i64 4
  %39 = getelementptr inbounds i8, ptr %37, i64 8
  %40 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %37, ptr noundef nonnull %38)
  %41 = load i32, ptr %37, align 4, !tbaa !5
  %.not101 = icmp eq i32 %41, 2
  br i1 %.not101, label %.thread, label %42

42:                                               ; preds = %.lr.ph
  %43 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.5, ptr noundef nonnull %39)
  %.pr = load i32, ptr %37, align 4, !tbaa !5
  %.not102 = icmp eq i32 %.pr, 1
  br i1 %.not102, label %44, label %.thread

44:                                               ; preds = %42
  %45 = load i32, ptr @rad, align 4, !tbaa !5
  %46 = load i32, ptr %38, align 4, !tbaa !5
  %47 = add nsw i32 %46, %45
  %48 = call noundef i64 @_Z3sqri(i32 noundef %47)
  %49 = load i32, ptr @rad, align 4, !tbaa !5
  %50 = load i32, ptr %38, align 4, !tbaa !5
  %51 = sub nsw i32 %49, %50
  %52 = call noundef i64 @_Z3sqri(i32 noundef %51)
  %53 = load i32, ptr %39, align 4, !tbaa !5
  %54 = call noundef i64 @_Z3sqri(i32 noundef %53)
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %1) #10
  %55 = load i32, ptr @rad, align 4, !tbaa !5
  %56 = load i32, ptr %38, align 4, !tbaa !5
  %57 = add nsw i32 %56, %55
  %58 = call noundef i32 @_Z3sgni(i32 noundef %57)
  %59 = sext i32 %58 to i64
  %60 = mul nsw i64 %48, %59
  %61 = add nsw i64 %54, %48
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %1, i64 noundef %60, i64 noundef %61)
  %62 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pL, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %62, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 16, i1 false), !tbaa.struct !9
  %63 = load i32, ptr @totL, align 4, !tbaa !5
  %64 = add nsw i32 %63, 1
  store i32 %64, ptr @totL, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [500001 x %struct.Fraction], ptr @seqL, i64 0, i64 %65
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %66, ptr noundef nonnull align 8 dereferenceable(16) %1, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %1) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %2) #10
  %67 = load i32, ptr @rad, align 4, !tbaa !5
  %68 = load i32, ptr %38, align 4, !tbaa !5
  %69 = sub nsw i32 %67, %68
  %70 = call noundef i32 @_Z3sgni(i32 noundef %69)
  %71 = sext i32 %70 to i64
  %72 = mul nsw i64 %52, %71
  %73 = add nsw i64 %54, %52
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %2, i64 noundef %72, i64 noundef %73)
  %74 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pR, i64 0, i64 %indvars.iv
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %74, ptr noundef nonnull align 8 dereferenceable(16) %2, i64 16, i1 false), !tbaa.struct !9
  %75 = load i32, ptr @totR, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr @totR, align 4, !tbaa !5
  %77 = sext i32 %76 to i64
  %78 = getelementptr inbounds [500001 x %struct.Fraction], ptr @seqR, i64 0, i64 %77
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %78, ptr noundef nonnull align 8 dereferenceable(16) %2, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %2) #10
  br label %.thread

.thread:                                          ; preds = %.lr.ph, %42, %44
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %79 = load i32, ptr @n, align 4, !tbaa !5
  %80 = sext i32 %79 to i64
  %.not.not = icmp slt i64 %indvars.iv, %80
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !12

._crit_edge111:                                   ; preds = %147, %._crit_edge
  %81 = load i32, ptr @cnt, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds i32, ptr @ord, i64 %82
  %84 = getelementptr inbounds i8, ptr %83, i64 4
  call void @_ZSt4sortIPiPFbRKiS2_EEvT_S5_T0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @ord, i64 4), ptr noundef nonnull %84, ptr noundef nonnull @_Z3cmpRKiS0_)
  %85 = load i32, ptr @cnt, align 4, !tbaa !5
  %.not97112 = icmp slt i32 %85, 1
  br i1 %.not97112, label %._crit_edge116, label %.lr.ph115.preheader

.lr.ph115.preheader:                              ; preds = %._crit_edge111
  %86 = zext nneg i32 %85 to i64
  %xtraiter = and i64 %86, 3
  %87 = icmp ult i32 %85, 4
  br i1 %87, label %._crit_edge116.loopexit.unr-lcssa, label %.lr.ph115.preheader.new

.lr.ph115.preheader.new:                          ; preds = %.lr.ph115.preheader
  %unroll_iter = and i64 %86, 2147483644
  br label %.lr.ph115

.lr.ph110:                                        ; preds = %._crit_edge, %147
  %88 = phi i32 [ %148, %147 ], [ %36, %._crit_edge ]
  %indvars.iv124 = phi i64 [ %indvars.iv.next125, %147 ], [ 1, %._crit_edge ]
  %89 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %indvars.iv124
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = icmp eq i32 %90, 1
  br i1 %91, label %92, label %147

92:                                               ; preds = %.lr.ph110
  %93 = getelementptr inbounds i8, ptr %89, i64 8
  %94 = getelementptr inbounds i8, ptr %89, i64 4
  %95 = load i32, ptr %94, align 4, !tbaa !5
  %96 = load i32, ptr %93, align 4, !tbaa !5
  %97 = load i32, ptr @totL, align 4, !tbaa !5
  %98 = sext i32 %97 to i64
  %gep = getelementptr %struct.Fraction, ptr getelementptr inbounds (i8, ptr @seqL, i64 16), i64 %98
  %99 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pL, i64 0, i64 %indvars.iv124
  %100 = call noundef ptr @_ZSt11lower_boundIP8FractionS0_ET_S2_S2_RKT0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seqL, i64 16), ptr noundef nonnull %gep, ptr noundef nonnull align 8 dereferenceable(16) %99)
  %101 = ptrtoint ptr %100 to i64
  %102 = sub i64 %101, ptrtoint (ptr @seqL to i64)
  %103 = lshr exact i64 %102, 4
  %104 = trunc i64 %103 to i32
  store i32 %104, ptr %94, align 4, !tbaa !5
  %105 = load i32, ptr @totR, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %gep106 = getelementptr %struct.Fraction, ptr getelementptr inbounds (i8, ptr @seqR, i64 16), i64 %106
  %107 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pR, i64 0, i64 %indvars.iv124
  %108 = call noundef ptr @_ZSt11lower_boundIP8FractionS0_ET_S2_S2_RKT0_(ptr noundef nonnull getelementptr inbounds (i8, ptr @seqR, i64 16), ptr noundef nonnull %gep106, ptr noundef nonnull align 8 dereferenceable(16) %107)
  %109 = ptrtoint ptr %108 to i64
  %110 = sub i64 %109, ptrtoint (ptr @seqR to i64)
  %111 = lshr exact i64 %110, 4
  %112 = trunc i64 %111 to i32
  store i32 %112, ptr %93, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %3) #10
  %113 = load i32, ptr @rad, align 4, !tbaa !5
  %114 = sub nsw i32 0, %113
  %.not99 = icmp slt i32 %95, %114
  br i1 %.not99, label %125, label %115

115:                                              ; preds = %92
  %116 = add nsw i32 %113, %95
  %117 = call noundef i64 @_Z3sqri(i32 noundef %116)
  %118 = call noundef i64 @_Z3sqri(i32 noundef %96)
  %119 = sub nsw i64 %117, %118
  %120 = load i32, ptr @rad, align 4, !tbaa !5
  %121 = add nsw i32 %120, %95
  %122 = call noundef i64 @_Z3sqri(i32 noundef %121)
  %123 = call noundef i64 @_Z3sqri(i32 noundef %96)
  %124 = add nsw i64 %123, %122
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef %119, i64 noundef %124)
  br label %126

125:                                              ; preds = %92
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %3, i64 noundef -1, i64 noundef 1)
  br label %126

126:                                              ; preds = %125, %115
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %99, ptr noundef nonnull align 8 dereferenceable(16) %3, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %3) #10
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %4) #10
  %127 = load i32, ptr @rad, align 4, !tbaa !5
  %.not100 = icmp sgt i32 %95, %127
  br i1 %.not100, label %139, label %128

128:                                              ; preds = %126
  %129 = call noundef i64 @_Z3sqri(i32 noundef %96)
  %130 = load i32, ptr @rad, align 4, !tbaa !5
  %131 = sub nsw i32 %95, %130
  %132 = call noundef i64 @_Z3sqri(i32 noundef %131)
  %133 = sub nsw i64 %129, %132
  %134 = load i32, ptr @rad, align 4, !tbaa !5
  %135 = sub nsw i32 %95, %134
  %136 = call noundef i64 @_Z3sqri(i32 noundef %135)
  %137 = call noundef i64 @_Z3sqri(i32 noundef %96)
  %138 = add nsw i64 %137, %136
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef %133, i64 noundef %138)
  br label %140

139:                                              ; preds = %126
  call void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16) %4, i64 noundef 1, i64 noundef 1)
  br label %140

140:                                              ; preds = %139, %128
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 16 dereferenceable(16) %107, ptr noundef nonnull align 8 dereferenceable(16) %4, i64 16, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %4) #10
  %141 = load i32, ptr @cnt, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr @cnt, align 4, !tbaa !5
  %143 = sext i32 %142 to i64
  %144 = getelementptr inbounds [500001 x i32], ptr @ord, i64 0, i64 %143
  %145 = trunc nuw nsw i64 %indvars.iv124 to i32
  store i32 %145, ptr %144, align 4, !tbaa !5
  %146 = getelementptr inbounds [500001 x i32], ptr @idx, i64 0, i64 %143
  store i32 %145, ptr %146, align 4, !tbaa !5
  %.pre = load i32, ptr @n, align 4, !tbaa !5
  br label %147

147:                                              ; preds = %140, %.lr.ph110
  %148 = phi i32 [ %.pre, %140 ], [ %88, %.lr.ph110 ]
  %indvars.iv.next125 = add nuw nsw i64 %indvars.iv124, 1
  %149 = sext i32 %148 to i64
  %.not96.not = icmp slt i64 %indvars.iv124, %149
  br i1 %.not96.not, label %.lr.ph110, label %._crit_edge111, !llvm.loop !14

._crit_edge116.loopexit.unr-lcssa:                ; preds = %.lr.ph115, %.lr.ph115.preheader
  %indvars.iv127.unr = phi i64 [ 1, %.lr.ph115.preheader ], [ %indvars.iv.next128.3, %.lr.ph115 ]
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %._crit_edge116, label %.lr.ph115.epil

.lr.ph115.epil:                                   ; preds = %._crit_edge116.loopexit.unr-lcssa, %.lr.ph115.epil
  %indvars.iv127.epil = phi i64 [ %indvars.iv.next128.epil, %.lr.ph115.epil ], [ %indvars.iv127.unr, %._crit_edge116.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph115.epil ], [ 0, %._crit_edge116.loopexit.unr-lcssa ]
  %150 = getelementptr inbounds [500001 x i32], ptr @ord, i64 0, i64 %indvars.iv127.epil
  %151 = load i32, ptr %150, align 4, !tbaa !5
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %152
  %154 = trunc nuw nsw i64 %indvars.iv127.epil to i32
  store i32 %154, ptr %153, align 4, !tbaa !5
  %indvars.iv.next128.epil = add nuw nsw i64 %indvars.iv127.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %._crit_edge116, label %.lr.ph115.epil, !llvm.loop !15

._crit_edge116:                                   ; preds = %._crit_edge116.loopexit.unr-lcssa, %.lr.ph115.epil, %._crit_edge111
  %155 = shl i32 %85, 1
  %156 = sext i32 %155 to i64
  %157 = shl nsw i64 %156, 2
  call void @llvm.memset.p0.i64(ptr nonnull align 4 getelementptr inbounds (i8, ptr @seg, i64 4), i8 63, i64 %157, i1 false)
  %158 = load i32, ptr @n, align 4, !tbaa !5
  %.not98118 = icmp slt i32 %158, 1
  br i1 %.not98118, label %._crit_edge122, label %.lr.ph121

.lr.ph115:                                        ; preds = %.lr.ph115, %.lr.ph115.preheader.new
  %indvars.iv127 = phi i64 [ 1, %.lr.ph115.preheader.new ], [ %indvars.iv.next128.3, %.lr.ph115 ]
  %niter = phi i64 [ 0, %.lr.ph115.preheader.new ], [ %niter.next.3, %.lr.ph115 ]
  %159 = getelementptr inbounds [500001 x i32], ptr @ord, i64 0, i64 %indvars.iv127
  %160 = load i32, ptr %159, align 4, !tbaa !5
  %161 = sext i32 %160 to i64
  %162 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %161
  %163 = trunc nuw nsw i64 %indvars.iv127 to i32
  store i32 %163, ptr %162, align 4, !tbaa !5
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %164 = getelementptr inbounds [500001 x i32], ptr @ord, i64 0, i64 %indvars.iv.next128
  %165 = load i32, ptr %164, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %166
  %168 = trunc nuw nsw i64 %indvars.iv.next128 to i32
  store i32 %168, ptr %167, align 4, !tbaa !5
  %indvars.iv.next128.1 = add nuw nsw i64 %indvars.iv127, 2
  %169 = getelementptr inbounds [500001 x i32], ptr @ord, i64 0, i64 %indvars.iv.next128.1
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %171
  %173 = trunc nuw nsw i64 %indvars.iv.next128.1 to i32
  store i32 %173, ptr %172, align 4, !tbaa !5
  %indvars.iv.next128.2 = add nuw nsw i64 %indvars.iv127, 3
  %174 = getelementptr inbounds [500001 x i32], ptr @ord, i64 0, i64 %indvars.iv.next128.2
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %176
  %178 = trunc nuw nsw i64 %indvars.iv.next128.2 to i32
  store i32 %178, ptr %177, align 4, !tbaa !5
  %indvars.iv.next128.3 = add nuw nsw i64 %indvars.iv127, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %._crit_edge116.loopexit.unr-lcssa, label %.lr.ph115, !llvm.loop !17

._crit_edge122:                                   ; preds = %292, %._crit_edge116
  ret i32 0

.lr.ph121:                                        ; preds = %._crit_edge116, %292
  %indvars.iv130 = phi i64 [ %indvars.iv.next131, %292 ], [ 1, %._crit_edge116 ]
  %179 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %indvars.iv130
  %180 = getelementptr inbounds i8, ptr %179, i64 4
  %181 = getelementptr inbounds i8, ptr %179, i64 8
  %182 = load i32, ptr %179, align 4, !tbaa !5
  switch i32 %182, label %206 [
    i32 1, label %183
    i32 2, label %189
  ]

183:                                              ; preds = %.lr.ph121
  %184 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %indvars.iv130
  store i8 1, ptr %184, align 1, !tbaa !18
  %185 = load i32, ptr @cnt, align 4, !tbaa !5
  %186 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %indvars.iv130
  %187 = load i32, ptr %186, align 4, !tbaa !5
  %188 = load i32, ptr %181, align 4, !tbaa !20
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %185, i32 noundef %187, i32 noundef %188)
  br label %292

189:                                              ; preds = %.lr.ph121
  %190 = load i32, ptr %180, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [500001 x i32], ptr @idx, i64 0, i64 %191
  %193 = load i32, ptr %192, align 4, !tbaa !5
  store i32 %193, ptr %180, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %194
  %196 = load i8, ptr %195, align 1, !tbaa !18, !range !22, !noundef !23
  %197 = trunc nuw i8 %196 to i1
  br i1 %197, label %199, label %198

198:                                              ; preds = %189
  call void @__assert_fail(ptr noundef nonnull @.str.6, ptr noundef nonnull @.str.7, i32 noundef 103, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #11
  unreachable

199:                                              ; preds = %189
  %200 = load i32, ptr @cnt, align 4, !tbaa !5
  %201 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %194
  %202 = load i32, ptr %201, align 4, !tbaa !5
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %200, i32 noundef %202, i32 noundef 1061109567)
  %203 = load i32, ptr %180, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %204
  store i8 0, ptr %205, align 1, !tbaa !18
  br label %292

206:                                              ; preds = %.lr.ph121
  %207 = load i32, ptr %180, align 4, !tbaa !5
  %208 = sext i32 %207 to i64
  %209 = getelementptr inbounds [500001 x i32], ptr @idx, i64 0, i64 %208
  %210 = load i32, ptr %209, align 4, !tbaa !5
  store i32 %210, ptr %180, align 4, !tbaa !5
  %211 = load i32, ptr %181, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds [500001 x i32], ptr @idx, i64 0, i64 %212
  %214 = load i32, ptr %213, align 4, !tbaa !5
  store i32 %214, ptr %181, align 4, !tbaa !5
  %215 = sext i32 %210 to i64
  %216 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %215
  %217 = load i8, ptr %216, align 1, !tbaa !18, !range !22, !noundef !23
  %218 = trunc nuw i8 %217 to i1
  br i1 %218, label %219, label %.critedge

219:                                              ; preds = %206
  %220 = sext i32 %214 to i64
  %221 = getelementptr inbounds [500001 x i8], ptr @_ZZ4mainE3vis, i64 0, i64 %220
  %222 = load i8, ptr %221, align 1, !tbaa !18, !range !22, !noundef !23
  %223 = trunc nuw i8 %222 to i1
  br i1 %223, label %224, label %.critedge

.critedge:                                        ; preds = %206, %219
  call void @__assert_fail(ptr noundef nonnull @.str.8, ptr noundef nonnull @.str.7, i32 noundef 109, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #11
  unreachable

224:                                              ; preds = %219
  %225 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pR, i64 0, i64 %215
  %226 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pR, i64 0, i64 %220
  %227 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3minI8FractionERKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(16) %225, ptr noundef nonnull align 8 dereferenceable(16) %226)
  %228 = load i32, ptr %180, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pL, i64 0, i64 %229
  %231 = load i32, ptr %181, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [500001 x %struct.Fraction], ptr @pL, i64 0, i64 %232
  %234 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3maxI8FractionERKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(16) %230, ptr noundef nonnull align 8 dereferenceable(16) %233)
  %235 = call noundef zeroext i1 @_ZNK8FractionltERKS_(ptr noundef nonnull align 8 dereferenceable(16) %227, ptr noundef nonnull align 8 dereferenceable(16) %234)
  br i1 %235, label %236, label %238

236:                                              ; preds = %224
  %237 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.9)
  br label %292

238:                                              ; preds = %224
  %239 = load i32, ptr %180, align 4, !tbaa !5
  %240 = sext i32 %239 to i64
  %241 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %240, i32 1
  %242 = load i32, ptr %181, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %243, i32 1
  %245 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %241, ptr noundef nonnull align 4 dereferenceable(4) %244)
  %246 = load i32, ptr %245, align 4, !tbaa !5
  %247 = load i32, ptr %180, align 4, !tbaa !5
  %248 = sext i32 %247 to i64
  %249 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %248, i32 2
  %250 = load i32, ptr %181, align 4, !tbaa !5
  %251 = sext i32 %250 to i64
  %252 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %251, i32 2
  %253 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3maxIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %249, ptr noundef nonnull align 4 dereferenceable(4) %252)
  %254 = load i32, ptr %253, align 4, !tbaa !5
  %255 = load i32, ptr @cnt, align 4, !tbaa !5
  %256 = load i32, ptr %180, align 4, !tbaa !5
  %257 = sext i32 %256 to i64
  %258 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %257
  %259 = load i32, ptr %258, align 4, !tbaa !5
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %255, i32 noundef %259, i32 noundef 1061109567)
  %260 = load i32, ptr @cnt, align 4, !tbaa !5
  %261 = load i32, ptr %181, align 4, !tbaa !5
  %262 = sext i32 %261 to i64
  %263 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %262
  %264 = load i32, ptr %263, align 4, !tbaa !5
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %260, i32 noundef %264, i32 noundef 1061109567)
  store i32 0, ptr @que, align 16, !tbaa !5
  store i32 %246, ptr getelementptr inbounds (i8, ptr @que, i64 4), align 4, !tbaa !5
  store i32 0, ptr getelementptr inbounds (i8, ptr @que, i64 8), align 8, !tbaa !5
  %265 = load i32, ptr @cnt, align 4, !tbaa !5
  %266 = sext i32 %265 to i64
  %gep117 = getelementptr i32, ptr getelementptr inbounds (i8, ptr @ord, i64 4), i64 %266
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #10
  store i32 0, ptr %5, align 4, !tbaa !5
  %267 = call noundef ptr @_ZSt11upper_boundIPiiPFbRKiS2_EET_S5_S5_RKT0_T1_(ptr noundef nonnull getelementptr inbounds (i8, ptr @ord, i64 4), ptr noundef nonnull %gep117, ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull @_Z3cmpRKiS0_)
  %268 = ptrtoint ptr %267 to i64
  %269 = sub i64 %268, ptrtoint (ptr @ord to i64)
  %270 = lshr exact i64 %269, 2
  %271 = trunc i64 %270 to i32
  %272 = add i32 %271, -1
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #10
  %273 = load i32, ptr @cnt, align 4, !tbaa !5
  %274 = call noundef i32 @_Z7seg_queiiii(i32 noundef 1, i32 noundef %273, i32 noundef 1, i32 noundef %272)
  %275 = icmp sgt i32 %274, %254
  %276 = select i1 %275, ptr @.str.10, ptr @.str.9
  %277 = call i32 @puts(ptr noundef nonnull dereferenceable(1) %276)
  %278 = load i32, ptr @cnt, align 4, !tbaa !5
  %279 = load i32, ptr %180, align 4, !tbaa !5
  %280 = sext i32 %279 to i64
  %281 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %280
  %282 = load i32, ptr %281, align 4, !tbaa !5
  %283 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %280, i32 2
  %284 = load i32, ptr %283, align 4, !tbaa !20
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %278, i32 noundef %282, i32 noundef %284)
  %285 = load i32, ptr @cnt, align 4, !tbaa !5
  %286 = load i32, ptr %181, align 4, !tbaa !5
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [500001 x i32], ptr @pos, i64 0, i64 %287
  %289 = load i32, ptr %288, align 4, !tbaa !5
  %290 = getelementptr inbounds [500001 x %struct.Query], ptr @que, i64 0, i64 %287, i32 2
  %291 = load i32, ptr %290, align 4, !tbaa !20
  call void @_Z7seg_updiiii(i32 noundef 1, i32 noundef %285, i32 noundef %289, i32 noundef %291)
  br label %292

292:                                              ; preds = %183, %238, %199, %236
  %indvars.iv.next131 = add nuw nsw i64 %indvars.iv130, 1
  %293 = load i32, ptr @n, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %.not98.not = icmp slt i64 %indvars.iv130, %294
  br i1 %.not98.not, label %.lr.ph121, label %._crit_edge122, !llvm.loop !24
}

; 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 i64 @_Z3sqri(i32 noundef) local_unnamed_addr #5

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef i32 @_Z3sgni(i32 noundef) local_unnamed_addr #5

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN8FractionC2Exx(ptr noundef nonnull align 8 dereferenceable(16), i64 noundef, i64 noundef) unnamed_addr #0 align 2

; Function Attrs: mustprogress 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) #6

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIP8FractionS0_ET_S2_S2_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #7

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #9

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3minI8FractionERKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #7

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef zeroext i1 @_ZNK8FractionltERKS_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #2 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZSt3maxI8FractionERKT_S3_S3_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #5

; Function Attrs: nofree nounwind
declare noundef i32 @puts(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 noundef ptr @_ZSt11upper_boundIPiiPFbRKiS2_EET_S5_S5_RKT0_T1_(ptr noundef, ptr noundef, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef) local_unnamed_addr #7

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 nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { nofree nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { inlinehint mustprogress 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 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { 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 #8 = { mustprogress nocallback nofree nounwind willreturn memory(argmem: write) }
attributes #9 = { noreturn 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 #10 = { nounwind }
attributes #11 = { noreturn 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 = !{i64 0, i64 8, !10, i64 8, i64 8, !10}
!10 = !{!11, !11, i64 0}
!11 = !{!"long long", !7, i64 0}
!12 = distinct !{!12, !13}
!13 = !{!"llvm.loop.mustprogress"}
!14 = distinct !{!14, !13}
!15 = distinct !{!15, !16}
!16 = !{!"llvm.loop.unroll.disable"}
!17 = distinct !{!17, !13}
!18 = !{!19, !19, i64 0}
!19 = !{!"bool", !7, i64 0}
!20 = !{!21, !6, i64 8}
!21 = !{!"_ZTS5Query", !6, i64 0, !6, i64 4, !6, i64 8}
!22 = !{i8 0, i8 2}
!23 = !{}
!24 = distinct !{!24, !13}


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