; LLVM IR from tangjz/acm-icpc :: Summer_Training/2016-07-19 (D - GCD - tjz)

; 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, i32 }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.0" = type { i32, i64 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@a = external dso_local global [100010 x i32], align 16
@q = external dso_local global i32, align 4
@b = external dso_local global [100010 x %struct.Query], align 16
@tot = external dso_local global i32, align 4
@cnt = external dso_local global i32, align 4
@g = external dso_local global [100010 x %"struct.std::pair"], align 16
@que = external dso_local global [1800180 x %"struct.std::pair.0"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1

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

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

31:                                               ; preds = %332, %0
  %32 = load i32, ptr %2, align 4, !tbaa !5
  %33 = load i32, ptr @t, 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) #6
  br label %335

36:                                               ; preds = %31
  %37 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n)
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  store i32 1, ptr %4, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %48, %36
  %39 = load i32, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr @n, align 4, !tbaa !5
  %41 = icmp sle i32 %39, %40
  br i1 %41, label %43, label %42

42:                                               ; preds = %38
  store i32 5, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  br label %51

43:                                               ; preds = %38
  %44 = load i32, ptr %4, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds i32, ptr @a, i64 %45
  %47 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %46)
  br label %48

48:                                               ; preds = %43
  %49 = load i32, ptr %4, align 4, !tbaa !5
  %50 = add nsw i32 %49, 1
  store i32 %50, ptr %4, align 4, !tbaa !5
  br label %38, !llvm.loop !9

51:                                               ; preds = %42
  %52 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @q)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  store i32 0, ptr %5, align 4, !tbaa !5
  br label %53

53:                                               ; preds = %73, %51
  %54 = load i32, ptr %5, align 4, !tbaa !5
  %55 = load i32, ptr @q, align 4, !tbaa !5
  %56 = icmp slt i32 %54, %55
  br i1 %56, label %58, label %57

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

58:                                               ; preds = %53
  %59 = load i32, ptr %5, align 4, !tbaa !5
  %60 = load i32, ptr %5, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %61
  %63 = getelementptr inbounds %struct.Query, ptr %62, i32 0, i32 0
  store i32 %59, ptr %63, align 16, !tbaa !11
  %64 = load i32, ptr %5, align 4, !tbaa !5
  %65 = sext i32 %64 to i64
  %66 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %65
  %67 = getelementptr inbounds %struct.Query, ptr %66, i32 0, i32 1
  %68 = load i32, ptr %5, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %69
  %71 = getelementptr inbounds %struct.Query, ptr %70, i32 0, i32 2
  %72 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %67, ptr noundef %71)
  br label %73

73:                                               ; preds = %58
  %74 = load i32, ptr %5, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr %5, align 4, !tbaa !5
  br label %53, !llvm.loop !13

76:                                               ; preds = %57
  %77 = load i32, ptr @q, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds %struct.Query, ptr @b, i64 %78
  call void @_ZSt4sortIP5QueryEvT_S2_(ptr noundef @b, ptr noundef %79)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  store i32 1, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %80

80:                                               ; preds = %242, %76
  %81 = load i32, ptr %6, align 4, !tbaa !5
  %82 = load i32, ptr @n, align 4, !tbaa !5
  %83 = icmp sle i32 %81, %82
  br i1 %83, label %85, label %84

84:                                               ; preds = %80
  store i32 11, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  br label %245

85:                                               ; preds = %80
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  store i32 0, ptr %9, align 4, !tbaa !5
  %86 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %9)
  store i64 %86, ptr %8, align 4
  %87 = load i32, ptr @tot, align 4, !tbaa !5
  %88 = add nsw i32 %87, 1
  store i32 %88, ptr @tot, align 4, !tbaa !5
  %89 = sext i32 %87 to i64
  %90 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %89
  %91 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %90, ptr noundef nonnull align 4 dereferenceable(8) %8) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 0, ptr %10, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %112, %85
  %93 = load i32, ptr %10, align 4, !tbaa !5
  %94 = load i32, ptr @tot, align 4, !tbaa !5
  %95 = icmp slt i32 %93, %94
  br i1 %95, label %97, label %96

96:                                               ; preds = %92
  store i32 14, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %115

97:                                               ; preds = %92
  %98 = load i32, ptr %10, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %99
  %101 = getelementptr inbounds %"struct.std::pair", ptr %100, i32 0, i32 1
  %102 = load i32, ptr %101, align 4, !tbaa !14
  %103 = load i32, ptr %6, align 4, !tbaa !5
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !5
  %107 = call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %102, i32 noundef %106)
  %108 = load i32, ptr %10, align 4, !tbaa !5
  %109 = sext i32 %108 to i64
  %110 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %109
  %111 = getelementptr inbounds %"struct.std::pair", ptr %110, i32 0, i32 1
  store i32 %107, ptr %111, align 4, !tbaa !14
  br label %112

112:                                              ; preds = %97
  %113 = load i32, ptr %10, align 4, !tbaa !5
  %114 = add nsw i32 %113, 1
  store i32 %114, ptr %10, align 4, !tbaa !5
  br label %92, !llvm.loop !16

115:                                              ; preds = %96
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %116

116:                                              ; preds = %147, %115
  %117 = load i32, ptr %12, align 4, !tbaa !5
  %118 = load i32, ptr @tot, align 4, !tbaa !5
  %119 = icmp slt i32 %117, %118
  br i1 %119, label %121, label %120

120:                                              ; preds = %116
  store i32 17, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  br label %150

121:                                              ; preds = %116
  %122 = load i32, ptr %12, align 4, !tbaa !5
  %123 = icmp ne i32 %122, 0
  br i1 %123, label %124, label %137

124:                                              ; preds = %121
  %125 = load i32, ptr %11, align 4, !tbaa !5
  %126 = sub nsw i32 %125, 1
  %127 = sext i32 %126 to i64
  %128 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %127
  %129 = getelementptr inbounds %"struct.std::pair", ptr %128, i32 0, i32 1
  %130 = load i32, ptr %129, align 4, !tbaa !14
  %131 = load i32, ptr %12, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %132
  %134 = getelementptr inbounds %"struct.std::pair", ptr %133, i32 0, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !14
  %136 = icmp ne i32 %130, %135
  br i1 %136, label %137, label %146

137:                                              ; preds = %124, %121
  %138 = load i32, ptr %12, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %139
  %141 = load i32, ptr %11, align 4, !tbaa !5
  %142 = add nsw i32 %141, 1
  store i32 %142, ptr %11, align 4, !tbaa !5
  %143 = sext i32 %141 to i64
  %144 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %143
  %145 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %144, ptr noundef nonnull align 4 dereferenceable(8) %140)
  br label %146

146:                                              ; preds = %137, %124
  br label %147

147:                                              ; preds = %146
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = add nsw i32 %148, 1
  store i32 %149, ptr %12, align 4, !tbaa !5
  br label %116, !llvm.loop !17

150:                                              ; preds = %120
  %151 = load i32, ptr %11, align 4, !tbaa !5
  store i32 %151, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #6
  %152 = load i32, ptr %6, align 4, !tbaa !5
  %153 = add nsw i32 %152, 1
  store i32 %153, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  store i32 0, ptr %15, align 4, !tbaa !5
  %154 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %14, ptr noundef nonnull align 4 dereferenceable(4) %15)
  store i64 %154, ptr %13, align 4
  %155 = load i32, ptr @tot, align 4, !tbaa !5
  %156 = sext i32 %155 to i64
  %157 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %156
  %158 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %157, ptr noundef nonnull align 4 dereferenceable(8) %13) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #6
  store i32 0, ptr %16, align 4, !tbaa !5
  br label %159

159:                                              ; preds = %192, %150
  %160 = load i32, ptr %16, align 4, !tbaa !5
  %161 = load i32, ptr @tot, align 4, !tbaa !5
  %162 = icmp slt i32 %160, %161
  br i1 %162, label %164, label %163

163:                                              ; preds = %159
  store i32 20, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #6
  br label %195

164:                                              ; preds = %159
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #6
  %165 = load i32, ptr %16, align 4, !tbaa !5
  %166 = sext i32 %165 to i64
  %167 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %166
  %168 = getelementptr inbounds %"struct.std::pair", ptr %167, i32 0, i32 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #6
  %169 = load i32, ptr %16, align 4, !tbaa !5
  %170 = add nsw i32 %169, 1
  %171 = sext i32 %170 to i64
  %172 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %171
  %173 = getelementptr inbounds %"struct.std::pair", ptr %172, i32 0, i32 0
  %174 = load i32, ptr %173, align 8, !tbaa !18
  %175 = load i32, ptr %16, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %176
  %178 = getelementptr inbounds %"struct.std::pair", ptr %177, i32 0, i32 0
  %179 = load i32, ptr %178, align 8, !tbaa !18
  %180 = sub nsw i32 %174, %179
  %181 = sext i32 %180 to i64
  store i64 %181, ptr %18, align 8, !tbaa !19
  %182 = call { i32, i64 } @_ZSt9make_pairIRixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %168, ptr noundef nonnull align 8 dereferenceable(8) %18)
  %183 = getelementptr inbounds { i32, i64 }, ptr %17, i32 0, i32 0
  %184 = extractvalue { i32, i64 } %182, 0
  store i32 %184, ptr %183, align 8
  %185 = getelementptr inbounds { i32, i64 }, ptr %17, i32 0, i32 1
  %186 = extractvalue { i32, i64 } %182, 1
  store i64 %186, ptr %185, align 8
  %187 = load i32, ptr @cnt, align 4, !tbaa !5
  %188 = add nsw i32 %187, 1
  store i32 %188, ptr @cnt, align 4, !tbaa !5
  %189 = sext i32 %187 to i64
  %190 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %189
  %191 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIixEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %190, ptr noundef nonnull align 8 dereferenceable(16) %17) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #6
  br label %192

192:                                              ; preds = %164
  %193 = load i32, ptr %16, align 4, !tbaa !5
  %194 = add nsw i32 %193, 1
  store i32 %194, ptr %16, align 4, !tbaa !5
  br label %159, !llvm.loop !21

195:                                              ; preds = %163
  br label %196

196:                                              ; preds = %238, %195
  %197 = load i32, ptr %7, align 4, !tbaa !5
  %198 = load i32, ptr @q, align 4, !tbaa !5
  %199 = icmp slt i32 %197, %198
  br i1 %199, label %200, label %208

200:                                              ; preds = %196
  %201 = load i32, ptr %7, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %203 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %202
  %204 = getelementptr inbounds %struct.Query, ptr %203, i32 0, i32 2
  %205 = load i32, ptr %204, align 8, !tbaa !22
  %206 = load i32, ptr %6, align 4, !tbaa !5
  %207 = icmp eq i32 %205, %206
  br label %208

208:                                              ; preds = %200, %196
  %209 = phi i1 [ false, %196 ], [ %207, %200 ]
  br i1 %209, label %210, label %241

210:                                              ; preds = %208
  call void @llvm.lifetime.start.p0(i64 4, ptr %19) #6
  %211 = load i32, ptr @tot, align 4, !tbaa !5
  %212 = sext i32 %211 to i64
  %213 = getelementptr inbounds %"struct.std::pair", ptr @g, i64 %212
  %214 = getelementptr inbounds %"struct.std::pair", ptr %213, i64 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #6
  %215 = load i32, ptr %7, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %216
  %218 = getelementptr inbounds %struct.Query, ptr %217, i32 0, i32 1
  %219 = load i32, ptr %218, align 4, !tbaa !23
  %220 = add nsw i32 %219, 1
  store i32 %220, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #6
  store i32 0, ptr %22, align 4, !tbaa !5
  %221 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %21, ptr noundef nonnull align 4 dereferenceable(4) %22)
  store i64 %221, ptr %20, align 4
  %222 = call noundef ptr @_ZSt11lower_boundIPSt4pairIiiES1_ET_S3_S3_RKT0_(ptr noundef @g, ptr noundef %214, ptr noundef nonnull align 4 dereferenceable(8) %20)
  %223 = ptrtoint ptr %222 to i64
  %224 = sub i64 %223, ptrtoint (ptr @g to i64)
  %225 = sdiv exact i64 %224, 8
  %226 = trunc i64 %225 to i32
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  store i32 %226, ptr %19, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #6
  %227 = load i32, ptr %19, align 4, !tbaa !5
  %228 = sub nsw i32 %227, 1
  %229 = sext i32 %228 to i64
  %230 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %229
  %231 = getelementptr inbounds %"struct.std::pair", ptr %230, i32 0, i32 1
  %232 = load i32, ptr %231, align 4, !tbaa !14
  store i32 %232, ptr %23, align 4, !tbaa !5
  %233 = load i32, ptr %23, align 4, !tbaa !5
  %234 = load i32, ptr %7, align 4, !tbaa !5
  %235 = sext i32 %234 to i64
  %236 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %235
  %237 = getelementptr inbounds %struct.Query, ptr %236, i32 0, i32 3
  store i32 %233, ptr %237, align 4, !tbaa !24
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %19) #6
  br label %238

238:                                              ; preds = %210
  %239 = load i32, ptr %7, align 4, !tbaa !5
  %240 = add nsw i32 %239, 1
  store i32 %240, ptr %7, align 4, !tbaa !5
  br label %196, !llvm.loop !25

241:                                              ; preds = %208
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  br label %242

242:                                              ; preds = %241
  %243 = load i32, ptr %6, align 4, !tbaa !5
  %244 = add nsw i32 %243, 1
  store i32 %244, ptr %6, align 4, !tbaa !5
  br label %80, !llvm.loop !26

245:                                              ; preds = %84
  %246 = load i32, ptr @cnt, align 4, !tbaa !5
  %247 = sext i32 %246 to i64
  %248 = getelementptr inbounds %"struct.std::pair.0", ptr @que, i64 %247
  call void @_ZSt4sortIPSt4pairIixEEvT_S3_(ptr noundef @que, ptr noundef %248)
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #6
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %249

249:                                              ; preds = %293, %245
  %250 = load i32, ptr %24, align 4, !tbaa !5
  %251 = load i32, ptr @cnt, align 4, !tbaa !5
  %252 = icmp slt i32 %250, %251
  br i1 %252, label %254, label %253

253:                                              ; preds = %249
  store i32 26, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #6
  br label %296

254:                                              ; preds = %249
  %255 = load i32, ptr %24, align 4, !tbaa !5
  %256 = icmp ne i32 %255, 0
  br i1 %256, label %257, label %270

257:                                              ; preds = %254
  %258 = load i32, ptr @tot, align 4, !tbaa !5
  %259 = sub nsw i32 %258, 1
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %260
  %262 = getelementptr inbounds %"struct.std::pair.0", ptr %261, i32 0, i32 0
  %263 = load i32, ptr %262, align 16, !tbaa !27
  %264 = load i32, ptr %24, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %265
  %267 = getelementptr inbounds %"struct.std::pair.0", ptr %266, i32 0, i32 0
  %268 = load i32, ptr %267, align 16, !tbaa !27
  %269 = icmp ne i32 %263, %268
  br i1 %269, label %270, label %279

270:                                              ; preds = %257, %254
  %271 = load i32, ptr %24, align 4, !tbaa !5
  %272 = sext i32 %271 to i64
  %273 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %272
  %274 = load i32, ptr @tot, align 4, !tbaa !5
  %275 = add nsw i32 %274, 1
  store i32 %275, ptr @tot, align 4, !tbaa !5
  %276 = sext i32 %274 to i64
  %277 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %276
  %278 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIixEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %277, ptr noundef nonnull align 8 dereferenceable(16) %273)
  br label %292

279:                                              ; preds = %257
  %280 = load i32, ptr %24, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %281
  %283 = getelementptr inbounds %"struct.std::pair.0", ptr %282, i32 0, i32 1
  %284 = load i64, ptr %283, align 8, !tbaa !29
  %285 = load i32, ptr @tot, align 4, !tbaa !5
  %286 = sub nsw i32 %285, 1
  %287 = sext i32 %286 to i64
  %288 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %287
  %289 = getelementptr inbounds %"struct.std::pair.0", ptr %288, i32 0, i32 1
  %290 = load i64, ptr %289, align 8, !tbaa !29
  %291 = add nsw i64 %290, %284
  store i64 %291, ptr %289, align 8, !tbaa !29
  br label %292

292:                                              ; preds = %279, %270
  br label %293

293:                                              ; preds = %292
  %294 = load i32, ptr %24, align 4, !tbaa !5
  %295 = add nsw i32 %294, 1
  store i32 %295, ptr %24, align 4, !tbaa !5
  br label %249, !llvm.loop !30

296:                                              ; preds = %253
  %297 = load i32, ptr @tot, align 4, !tbaa !5
  store i32 %297, ptr @cnt, align 4, !tbaa !5
  %298 = load i32, ptr @q, align 4, !tbaa !5
  %299 = sext i32 %298 to i64
  %300 = getelementptr inbounds %struct.Query, ptr @b, i64 %299
  call void @_ZSt4sortIP5QueryPFbRKS0_S3_EEvT_S6_T0_(ptr noundef @b, ptr noundef %300, ptr noundef @_Z3cmpRK5QueryS1_)
  %301 = load i32, ptr %2, align 4, !tbaa !5
  %302 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %301)
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #6
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %303

303:                                              ; preds = %328, %296
  %304 = load i32, ptr %25, align 4, !tbaa !5
  %305 = load i32, ptr @q, align 4, !tbaa !5
  %306 = icmp slt i32 %304, %305
  br i1 %306, label %308, label %307

307:                                              ; preds = %303
  store i32 29, ptr %3, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #6
  br label %331

308:                                              ; preds = %303
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #6
  %309 = load i32, ptr %25, align 4, !tbaa !5
  %310 = sext i32 %309 to i64
  %311 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %310
  %312 = getelementptr inbounds %struct.Query, ptr %311, i32 0, i32 3
  %313 = load i32, ptr %312, align 4, !tbaa !24
  store i32 %313, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %27) #6
  %314 = load i32, ptr @cnt, align 4, !tbaa !5
  %315 = sext i32 %314 to i64
  %316 = getelementptr inbounds %"struct.std::pair.0", ptr @que, i64 %315
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #6
  store i64 0, ptr %29, align 8, !tbaa !19
  %317 = call { i32, i64 } @_ZSt9make_pairIRixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %26, ptr noundef nonnull align 8 dereferenceable(8) %29)
  %318 = getelementptr inbounds { i32, i64 }, ptr %28, i32 0, i32 0
  %319 = extractvalue { i32, i64 } %317, 0
  store i32 %319, ptr %318, align 8
  %320 = getelementptr inbounds { i32, i64 }, ptr %28, i32 0, i32 1
  %321 = extractvalue { i32, i64 } %317, 1
  store i64 %321, ptr %320, align 8
  %322 = call noundef ptr @_ZSt11lower_boundIPSt4pairIixES1_ET_S3_S3_RKT0_(ptr noundef @que, ptr noundef %316, ptr noundef nonnull align 8 dereferenceable(16) %28)
  %323 = getelementptr inbounds %"struct.std::pair.0", ptr %322, i32 0, i32 1
  %324 = load i64, ptr %323, align 8, !tbaa !29
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #6
  store i64 %324, ptr %27, align 8, !tbaa !19
  %325 = load i32, ptr %26, align 4, !tbaa !5
  %326 = load i64, ptr %27, align 8, !tbaa !19
  %327 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %325, i64 noundef %326)
  call void @llvm.lifetime.end.p0(i64 8, ptr %27) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #6
  br label %328

328:                                              ; preds = %308
  %329 = load i32, ptr %25, align 4, !tbaa !5
  %330 = add nsw i32 %329, 1
  store i32 %330, ptr %25, align 4, !tbaa !5
  br label %303, !llvm.loop !31

331:                                              ; preds = %307
  br label %332

332:                                              ; preds = %331
  %333 = load i32, ptr %2, align 4, !tbaa !5
  %334 = add nsw i32 %333, 1
  store i32 %334, ptr %2, align 4, !tbaa !5
  br label %31, !llvm.loop !32

335:                                              ; preds = %35
  ret i32 0
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i32, i64 } @_ZSt9make_pairIRixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) #5

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPSt4pairIixES1_ET_S3_S3_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) #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 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 #2 = { "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!12, !6, i64 0}
!12 = !{!"_ZTS5Query", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!13 = distinct !{!13, !10}
!14 = !{!15, !6, i64 4}
!15 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10}
!18 = !{!15, !6, i64 0}
!19 = !{!20, !20, i64 0}
!20 = !{!"long long", !7, i64 0}
!21 = distinct !{!21, !10}
!22 = !{!12, !6, i64 8}
!23 = !{!12, !6, i64 4}
!24 = !{!12, !6, i64 12}
!25 = distinct !{!25, !10}
!26 = distinct !{!26, !10}
!27 = !{!28, !6, i64 0}
!28 = !{!"_ZTSSt4pairIixE", !6, i64 0, !20, i64 8}
!29 = !{!28, !20, i64 8}
!30 = distinct !{!30, !10}
!31 = distinct !{!31, !10}
!32 = distinct !{!32, !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, i32 }
%"struct.std::pair" = type { i32, i32 }
%"struct.std::pair.0" = type { i32, i64 }

@t = external dso_local global i32, align 4
@n = external dso_local global i32, align 4
@a = external dso_local global [100010 x i32], align 16
@q = external dso_local global i32, align 4
@b = external dso_local global [100010 x %struct.Query], align 16
@tot = external dso_local local_unnamed_addr global i32, align 4
@cnt = external dso_local local_unnamed_addr global i32, align 4
@g = external dso_local global [100010 x %"struct.std::pair"], align 16
@que = external dso_local global [1800180 x %"struct.std::pair.0"], align 16
@.str = external hidden unnamed_addr constant [3 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [11 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [10 x i8], align 1

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #1 {
  %1 = alloca i32, align 4
  %2 = alloca %"struct.std::pair", align 8
  %3 = alloca i32, align 4
  %4 = alloca %"struct.std::pair", align 8
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair.0", align 8
  %8 = alloca i64, align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca %"struct.std::pair.0", align 8
  %14 = alloca i64, align 8
  %15 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @t)
  %16 = load i32, ptr @t, align 4, !tbaa !5
  %.not99 = icmp slt i32 %16, 1
  br i1 %.not99, label %._crit_edge103, label %.lr.ph102

.lr.ph102:                                        ; preds = %0
  %17 = getelementptr inbounds i8, ptr %7, i64 8
  %18 = getelementptr inbounds i8, ptr %13, i64 8
  br label %19

._crit_edge103:                                   ; preds = %._crit_edge98, %0
  ret i32 0

19:                                               ; preds = %.lr.ph102, %._crit_edge98
  %.0100 = phi i32 [ 1, %.lr.ph102 ], [ %173, %._crit_edge98 ]
  %20 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n)
  %21 = load i32, ptr @n, align 4, !tbaa !5
  %.not5764 = icmp slt i32 %21, 1
  br i1 %.not5764, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %19
  %22 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @q)
  %23 = load i32, ptr @q, align 4, !tbaa !5
  %24 = icmp sgt i32 %23, 0
  br i1 %24, label %.lr.ph68, label %._crit_edge.._crit_edge69_crit_edge

._crit_edge.._crit_edge69_crit_edge:              ; preds = %._crit_edge
  %.pre140 = sext i32 %23 to i64
  br label %._crit_edge69

.lr.ph:                                           ; preds = %19, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %19 ]
  %25 = getelementptr inbounds i32, ptr @a, i64 %indvars.iv
  %26 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %25)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %27 = load i32, ptr @n, align 4, !tbaa !5
  %28 = sext i32 %27 to i64
  %.not57.not = icmp slt i64 %indvars.iv, %28
  br i1 %.not57.not, label %.lr.ph, label %._crit_edge, !llvm.loop !9

._crit_edge69:                                    ; preds = %.lr.ph68, %._crit_edge.._crit_edge69_crit_edge
  %.pre-phi = phi i64 [ %.pre140, %._crit_edge.._crit_edge69_crit_edge ], [ %37, %.lr.ph68 ]
  %29 = getelementptr inbounds %struct.Query, ptr @b, i64 %.pre-phi
  call void @_ZSt4sortIP5QueryEvT_S2_(ptr noundef nonnull @b, ptr noundef nonnull %29)
  store i32 0, ptr @cnt, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  store i32 1, ptr %1, align 4, !tbaa !5
  %30 = load i32, ptr @n, align 4, !tbaa !5
  %.not5886 = icmp slt i32 %30, 1
  br i1 %.not5886, label %._crit_edge90, label %.lr.ph89

.lr.ph68:                                         ; preds = %._crit_edge, %.lr.ph68
  %indvars.iv106 = phi i64 [ %indvars.iv.next107, %.lr.ph68 ], [ 0, %._crit_edge ]
  %31 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %indvars.iv106
  %32 = trunc nuw nsw i64 %indvars.iv106 to i32
  store i32 %32, ptr %31, align 16, !tbaa !11
  %33 = getelementptr inbounds i8, ptr %31, i64 4
  %34 = getelementptr inbounds i8, ptr %31, i64 8
  %35 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %33, ptr noundef nonnull %34)
  %indvars.iv.next107 = add nuw nsw i64 %indvars.iv106, 1
  %36 = load i32, ptr @q, align 4, !tbaa !5
  %37 = sext i32 %36 to i64
  %38 = icmp slt i64 %indvars.iv.next107, %37
  br i1 %38, label %.lr.ph68, label %._crit_edge69, !llvm.loop !13

._crit_edge90.loopexit:                           ; preds = %.critedge
  %.pre134 = load i32, ptr @cnt, align 4, !tbaa !5
  br label %._crit_edge90

._crit_edge90:                                    ; preds = %._crit_edge90.loopexit, %._crit_edge69
  %39 = phi i32 [ %.pre134, %._crit_edge90.loopexit ], [ 0, %._crit_edge69 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds %"struct.std::pair.0", ptr @que, i64 %40
  call void @_ZSt4sortIPSt4pairIixEEvT_S3_(ptr noundef nonnull @que, ptr noundef nonnull %41)
  store i32 0, ptr @tot, align 4, !tbaa !5
  %42 = load i32, ptr @cnt, align 4, !tbaa !5
  %43 = icmp sgt i32 %42, 0
  br i1 %43, label %44, label %._crit_edge94

44:                                               ; preds = %._crit_edge90
  store i32 1, ptr @tot, align 4, !tbaa !5
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIixEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) @que, ptr noundef nonnull align 8 dereferenceable(16) @que)
  %.pre136 = load i32, ptr @cnt, align 4, !tbaa !5
  %46 = icmp sgt i32 %.pre136, 1
  br i1 %46, label %.lr.ph93.peel.next, label %._crit_edge94.loopexit

.lr.ph89:                                         ; preds = %._crit_edge69, %.critedge
  %.05387 = phi i32 [ %.154.lcssa, %.critedge ], [ 0, %._crit_edge69 ]
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  store i32 0, ptr %3, align 4, !tbaa !5
  %47 = call i64 @_ZSt9make_pairIRiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %47, ptr %2, align 8
  %48 = load i32, ptr @tot, align 4, !tbaa !5
  %49 = add nsw i32 %48, 1
  store i32 %49, ptr @tot, align 4, !tbaa !5
  %50 = sext i32 %48 to i64
  %51 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %50
  %52 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %51, ptr noundef nonnull align 4 dereferenceable(8) %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  %53 = load i32, ptr @tot, align 4, !tbaa !5
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %.lr.ph72, label %._crit_edge76

.preheader63:                                     ; preds = %.lr.ph72
  %55 = icmp sgt i32 %66, 0
  br i1 %55, label %56, label %._crit_edge76

56:                                               ; preds = %.preheader63
  %57 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) @g, ptr noundef nonnull align 4 dereferenceable(8) @g)
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  %58 = icmp sgt i32 %.pre, 1
  br i1 %58, label %.lr.ph75.peel.next, label %._crit_edge76

.lr.ph72:                                         ; preds = %.lr.ph89, %.lr.ph72
  %indvars.iv109 = phi i64 [ %indvars.iv.next110, %.lr.ph72 ], [ 0, %.lr.ph89 ]
  %59 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %indvars.iv109, i32 1
  %60 = load i32, ptr %59, align 4, !tbaa !14
  %61 = load i32, ptr %1, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [100010 x i32], ptr @a, i64 0, i64 %62
  %64 = load i32, ptr %63, align 4, !tbaa !5
  %65 = call noundef i32 @_ZSt5__gcdIiET_S0_S0_(i32 noundef %60, i32 noundef %64)
  store i32 %65, ptr %59, align 4, !tbaa !14
  %indvars.iv.next110 = add nuw nsw i64 %indvars.iv109, 1
  %66 = load i32, ptr @tot, align 4, !tbaa !5
  %67 = sext i32 %66 to i64
  %68 = icmp slt i64 %indvars.iv.next110, %67
  br i1 %68, label %.lr.ph72, label %.preheader63, !llvm.loop !16

._crit_edge76:                                    ; preds = %91, %.lr.ph89, %56, %.preheader63
  %.051.lcssa = phi i32 [ 0, %.preheader63 ], [ 1, %56 ], [ 0, %.lr.ph89 ], [ %.1, %91 ]
  store i32 %.051.lcssa, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #6
  %69 = load i32, ptr %1, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  store i32 %70, ptr %5, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #6
  store i32 0, ptr %6, align 4, !tbaa !5
  %71 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %5, ptr noundef nonnull align 4 dereferenceable(4) %6)
  store i64 %71, ptr %4, align 8
  %72 = load i32, ptr @tot, align 4, !tbaa !5
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %73
  %75 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %74, ptr noundef nonnull align 4 dereferenceable(8) %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #6
  %76 = load i32, ptr @tot, align 4, !tbaa !5
  %77 = icmp sgt i32 %76, 0
  br i1 %77, label %.lr.ph80, label %.preheader

.lr.ph75.peel.next:                               ; preds = %56, %91
  %78 = phi i32 [ %92, %91 ], [ %.pre, %56 ]
  %indvars.iv112 = phi i64 [ %indvars.iv.next113, %91 ], [ 1, %56 ]
  %.05173 = phi i32 [ %.1, %91 ], [ 1, %56 ]
  %79 = add nsw i32 %.05173, -1
  %80 = sext i32 %79 to i64
  %81 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %80, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !14
  %83 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %indvars.iv112, i32 1
  %84 = load i32, ptr %83, align 4, !tbaa !14
  %.not62 = icmp eq i32 %82, %84
  br i1 %.not62, label %91, label %85

85:                                               ; preds = %.lr.ph75.peel.next
  %86 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %indvars.iv112
  %87 = add nsw i32 %.05173, 1
  %88 = sext i32 %.05173 to i64
  %89 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %88
  %90 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %89, ptr noundef nonnull align 4 dereferenceable(8) %86)
  %.pre133 = load i32, ptr @tot, align 4, !tbaa !5
  br label %91

91:                                               ; preds = %.lr.ph75.peel.next, %85
  %92 = phi i32 [ %.pre133, %85 ], [ %78, %.lr.ph75.peel.next ]
  %.1 = phi i32 [ %87, %85 ], [ %.05173, %.lr.ph75.peel.next ]
  %indvars.iv.next113 = add nuw nsw i64 %indvars.iv112, 1
  %93 = sext i32 %92 to i64
  %94 = icmp slt i64 %indvars.iv.next113, %93
  br i1 %94, label %.lr.ph75.peel.next, label %._crit_edge76, !llvm.loop !17

.preheader:                                       ; preds = %.lr.ph80, %._crit_edge76
  %95 = load i32, ptr @q, align 4, !tbaa !5
  %96 = icmp slt i32 %.05387, %95
  br i1 %96, label %.lr.ph82.preheader, label %.critedge

.lr.ph82.preheader:                               ; preds = %.preheader
  %97 = sext i32 %.05387 to i64
  br label %.lr.ph82

.lr.ph80:                                         ; preds = %._crit_edge76, %.lr.ph80
  %indvars.iv116 = phi i64 [ %indvars.iv.next117, %.lr.ph80 ], [ 0, %._crit_edge76 ]
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  %98 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %indvars.iv116
  %99 = getelementptr inbounds i8, ptr %98, i64 4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #6
  %indvars.iv.next117 = add nuw nsw i64 %indvars.iv116, 1
  %100 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %indvars.iv.next117
  %101 = load i32, ptr %100, align 8, !tbaa !19
  %102 = load i32, ptr %98, align 8, !tbaa !19
  %103 = sub nsw i32 %101, %102
  %104 = sext i32 %103 to i64
  store i64 %104, ptr %8, align 8, !tbaa !20
  %105 = call { i32, i64 } @_ZSt9make_pairIRixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %99, ptr noundef nonnull align 8 dereferenceable(8) %8)
  %106 = extractvalue { i32, i64 } %105, 0
  store i32 %106, ptr %7, align 8
  %107 = extractvalue { i32, i64 } %105, 1
  store i64 %107, ptr %17, align 8
  %108 = load i32, ptr @cnt, align 4, !tbaa !5
  %109 = add nsw i32 %108, 1
  store i32 %109, ptr @cnt, align 4, !tbaa !5
  %110 = sext i32 %108 to i64
  %111 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %110
  %112 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIixEaSEOS0_(ptr noundef nonnull align 8 dereferenceable(16) %111, ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  %113 = load i32, ptr @tot, align 4, !tbaa !5
  %114 = sext i32 %113 to i64
  %115 = icmp slt i64 %indvars.iv.next117, %114
  br i1 %115, label %.lr.ph80, label %.preheader, !llvm.loop !22

.lr.ph82:                                         ; preds = %.lr.ph82.preheader, %121
  %indvars.iv119 = phi i64 [ %97, %.lr.ph82.preheader ], [ %indvars.iv.next120, %121 ]
  %116 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %indvars.iv119
  %117 = getelementptr inbounds i8, ptr %116, i64 8
  %118 = load i32, ptr %117, align 8, !tbaa !23
  %119 = load i32, ptr %1, align 4, !tbaa !5
  %120 = icmp eq i32 %118, %119
  br i1 %120, label %121, label %.critedge.loopexit

121:                                              ; preds = %.lr.ph82
  %122 = load i32, ptr @tot, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %gep = getelementptr %"struct.std::pair", ptr getelementptr inbounds (i8, ptr @g, i64 8), i64 %123
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #6
  %124 = getelementptr inbounds i8, ptr %116, i64 4
  %125 = load i32, ptr %124, align 4, !tbaa !24
  %126 = add nsw i32 %125, 1
  store i32 %126, ptr %10, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #6
  store i32 0, ptr %11, align 4, !tbaa !5
  %127 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %10, ptr noundef nonnull align 4 dereferenceable(4) %11)
  store i64 %127, ptr %9, align 8
  %128 = call noundef ptr @_ZSt11lower_boundIPSt4pairIiiES1_ET_S3_S3_RKT0_(ptr noundef nonnull @g, ptr noundef nonnull %gep, ptr noundef nonnull align 4 dereferenceable(8) %9)
  %129 = ptrtoint ptr %128 to i64
  %130 = sub i64 %129, ptrtoint (ptr @g to i64)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #6
  %131 = shl i64 %130, 29
  %sext = add i64 %131, -4294967296
  %132 = ashr i64 %sext, 32
  %133 = getelementptr inbounds [100010 x %"struct.std::pair"], ptr @g, i64 0, i64 %132, i32 1
  %134 = load i32, ptr %133, align 4, !tbaa !14
  %135 = getelementptr inbounds i8, ptr %116, i64 12
  store i32 %134, ptr %135, align 4, !tbaa !25
  %indvars.iv.next120 = add nsw i64 %indvars.iv119, 1
  %136 = load i32, ptr @q, align 4, !tbaa !5
  %137 = sext i32 %136 to i64
  %138 = icmp slt i64 %indvars.iv.next120, %137
  br i1 %138, label %.lr.ph82, label %.critedge.loopexit, !llvm.loop !26

.critedge.loopexit:                               ; preds = %121, %.lr.ph82
  %.154.lcssa.ph.in = phi i64 [ %indvars.iv119, %.lr.ph82 ], [ %indvars.iv.next120, %121 ]
  %.154.lcssa.ph = trunc i64 %.154.lcssa.ph.in to i32
  br label %.critedge

.critedge:                                        ; preds = %.critedge.loopexit, %.preheader
  %.154.lcssa = phi i32 [ %.05387, %.preheader ], [ %.154.lcssa.ph, %.critedge.loopexit ]
  %139 = load i32, ptr %1, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %1, align 4, !tbaa !5
  %141 = load i32, ptr @n, align 4, !tbaa !5
  %.not58.not = icmp slt i32 %139, %141
  br i1 %.not58.not, label %.lr.ph89, label %._crit_edge90.loopexit, !llvm.loop !27

._crit_edge94.loopexit:                           ; preds = %169, %44
  %.pre139 = load i32, ptr @tot, align 4, !tbaa !5
  br label %._crit_edge94

._crit_edge94:                                    ; preds = %._crit_edge94.loopexit, %._crit_edge90
  %142 = phi i32 [ %.pre139, %._crit_edge94.loopexit ], [ 0, %._crit_edge90 ]
  store i32 %142, ptr @cnt, align 4, !tbaa !5
  %143 = load i32, ptr @q, align 4, !tbaa !5
  %144 = sext i32 %143 to i64
  %145 = getelementptr inbounds %struct.Query, ptr @b, i64 %144
  call void @_ZSt4sortIP5QueryPFbRKS0_S3_EEvT_S6_T0_(ptr noundef nonnull @b, ptr noundef nonnull %145, ptr noundef nonnull @_Z3cmpRK5QueryS1_)
  %146 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %.0100)
  %147 = load i32, ptr @q, align 4, !tbaa !5
  %148 = icmp sgt i32 %147, 0
  br i1 %148, label %.lr.ph97, label %._crit_edge98

.lr.ph93.peel.next:                               ; preds = %44, %169
  %149 = phi i32 [ %170, %169 ], [ %.pre136, %44 ]
  %indvars.iv122 = phi i64 [ %indvars.iv.next123, %169 ], [ 1, %44 ]
  %150 = load i32, ptr @tot, align 4, !tbaa !5
  %151 = add nsw i32 %150, -1
  %152 = sext i32 %151 to i64
  %153 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %152
  %154 = load i32, ptr %153, align 16, !tbaa !28
  %155 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %indvars.iv122
  %156 = load i32, ptr %155, align 16, !tbaa !28
  %.not60 = icmp eq i32 %154, %156
  br i1 %.not60, label %163, label %157

157:                                              ; preds = %.lr.ph93.peel.next
  %158 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %indvars.iv122
  %159 = add nsw i32 %150, 1
  store i32 %159, ptr @tot, align 4, !tbaa !5
  %160 = sext i32 %150 to i64
  %161 = getelementptr inbounds [1800180 x %"struct.std::pair.0"], ptr @que, i64 0, i64 %160
  %162 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt4pairIixEaSERKS0_(ptr noundef nonnull align 8 dereferenceable(16) %161, ptr noundef nonnull align 8 dereferenceable(16) %158)
  %.pre138 = load i32, ptr @cnt, align 4, !tbaa !5
  br label %169

163:                                              ; preds = %.lr.ph93.peel.next
  %164 = getelementptr inbounds i8, ptr %155, i64 8
  %165 = load i64, ptr %164, align 8, !tbaa !30
  %166 = getelementptr inbounds i8, ptr %153, i64 8
  %167 = load i64, ptr %166, align 8, !tbaa !30
  %168 = add nsw i64 %167, %165
  store i64 %168, ptr %166, align 8, !tbaa !30
  br label %169

169:                                              ; preds = %157, %163
  %170 = phi i32 [ %.pre138, %157 ], [ %149, %163 ]
  %indvars.iv.next123 = add nuw nsw i64 %indvars.iv122, 1
  %171 = sext i32 %170 to i64
  %172 = icmp slt i64 %indvars.iv.next123, %171
  br i1 %172, label %.lr.ph93.peel.next, label %._crit_edge94.loopexit, !llvm.loop !31

._crit_edge98:                                    ; preds = %.lr.ph97, %._crit_edge94
  %173 = add nuw nsw i32 %.0100, 1
  %174 = load i32, ptr @t, align 4, !tbaa !5
  %.not.not = icmp slt i32 %.0100, %174
  br i1 %.not.not, label %19, label %._crit_edge103, !llvm.loop !32

.lr.ph97:                                         ; preds = %._crit_edge94, %.lr.ph97
  %indvars.iv127 = phi i64 [ %indvars.iv.next128, %.lr.ph97 ], [ 0, %._crit_edge94 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #6
  %175 = getelementptr inbounds [100010 x %struct.Query], ptr @b, i64 0, i64 %indvars.iv127, i32 3
  %176 = load i32, ptr %175, align 4, !tbaa !25
  store i32 %176, ptr %12, align 4, !tbaa !5
  %177 = load i32, ptr @cnt, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds %"struct.std::pair.0", ptr @que, i64 %178
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %13) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #6
  store i64 0, ptr %14, align 8, !tbaa !20
  %180 = call { i32, i64 } @_ZSt9make_pairIRixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 8 dereferenceable(8) %14)
  %181 = extractvalue { i32, i64 } %180, 0
  store i32 %181, ptr %13, align 8
  %182 = extractvalue { i32, i64 } %180, 1
  store i64 %182, ptr %18, align 8
  %183 = call noundef ptr @_ZSt11lower_boundIPSt4pairIixES1_ET_S3_S3_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %179, ptr noundef nonnull align 8 dereferenceable(16) %13)
  %184 = getelementptr inbounds i8, ptr %183, i64 8
  %185 = load i64, ptr %184, align 8, !tbaa !30
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %13) #6
  %186 = load i32, ptr %12, align 4, !tbaa !5
  %187 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %186, i64 noundef %185)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #6
  %indvars.iv.next128 = add nuw nsw i64 %indvars.iv127, 1
  %188 = load i32, ptr @q, align 4, !tbaa !5
  %189 = sext i32 %188 to i64
  %190 = icmp slt i64 %indvars.iv.next128, %189
  br i1 %190, label %.lr.ph97, label %._crit_edge98, !llvm.loop !33
}

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #0 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { i32, i64 } @_ZSt9make_pairIRixESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #5

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local noundef ptr @_ZSt11lower_boundIPSt4pairIixES1_ET_S3_S3_RKT0_(ptr noundef, ptr noundef, ptr noundef nonnull align 8 dereferenceable(16)) 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 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 #2 = { 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 #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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 #5 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { 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 = !{!12, !6, i64 0}
!12 = !{!"_ZTS5Query", !6, i64 0, !6, i64 4, !6, i64 8, !6, i64 12}
!13 = distinct !{!13, !10}
!14 = !{!15, !6, i64 4}
!15 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!16 = distinct !{!16, !10}
!17 = distinct !{!17, !10, !18}
!18 = !{!"llvm.loop.peeled.count", i32 1}
!19 = !{!15, !6, i64 0}
!20 = !{!21, !21, i64 0}
!21 = !{!"long long", !7, i64 0}
!22 = distinct !{!22, !10}
!23 = !{!12, !6, i64 8}
!24 = !{!12, !6, i64 4}
!25 = !{!12, !6, i64 12}
!26 = distinct !{!26, !10}
!27 = distinct !{!27, !10}
!28 = !{!29, !6, i64 0}
!29 = !{!"_ZTSSt4pairIixE", !6, i64 0, !21, i64 8}
!30 = !{!29, !21, i64 8}
!31 = distinct !{!31, !10, !18}
!32 = distinct !{!32, !10}
!33 = distinct !{!33, !10}


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