; LLVM IR from lzyrapx/Competitive-Programming :: Retired_code/CDQ Divide and Conquer (HDU 5126（三维偏序）)

; 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, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@que = external dso_local global [100020 x i32], align 16
@ans = external dso_local global [50010 x i32], align 16
@numz = external dso_local global i32, align 4
@queries = external dso_local global [400080 x %struct.Query], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr noundef %1) #3 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca %struct.Query, align 4
  %18 = alloca %struct.Query, align 4
  %19 = alloca %struct.Query, align 4
  %20 = alloca %struct.Query, align 4
  %21 = alloca %struct.Query, align 4
  %22 = alloca %struct.Query, align 4
  %23 = alloca %struct.Query, align 4
  %24 = alloca %struct.Query, align 4
  %25 = alloca %struct.Query, align 4
  %26 = alloca i32, align 4
  %27 = alloca i32, align 4
  store i32 0, ptr %3, align 4
  store i32 %0, ptr %4, align 4, !tbaa !5
  store ptr %1, ptr %5, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #8
  %28 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  br label %29

29:                                               ; preds = %225, %2
  %30 = load i32, ptr %6, align 4, !tbaa !5
  %31 = add nsw i32 %30, -1
  store i32 %31, ptr %6, align 4, !tbaa !5
  %32 = icmp ne i32 %30, 0
  br i1 %32, label %33, label %226

33:                                               ; preds = %29
  call void @llvm.memset.p0.i64(ptr align 16 @ans, i8 -1, i64 200040, i1 false)
  store i32 0, ptr @numz, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %13)
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #8
  store i32 0, ptr %15, align 4, !tbaa !5
  br label %35

35:                                               ; preds = %159, %33
  %36 = load i32, ptr %15, align 4, !tbaa !5
  %37 = load i32, ptr %13, align 4, !tbaa !5
  %38 = icmp slt i32 %36, %37
  br i1 %38, label %40, label %39

39:                                               ; preds = %35
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #8
  br label %162

40:                                               ; preds = %35
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #8
  %41 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %42 = load i32, ptr %16, align 4, !tbaa !5
  %43 = icmp eq i32 %42, 1
  br i1 %43, label %44, label %61

44:                                               ; preds = %40
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %46 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %45, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %47 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %46, ptr noundef nonnull align 4 dereferenceable(4) %11)
  call void @llvm.lifetime.start.p0(i64 20, ptr %17) #8
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = load i32, ptr %9, align 4, !tbaa !5
  %50 = load i32, ptr %11, align 4, !tbaa !5
  %51 = load i32, ptr %15, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %17, i32 noundef %48, i32 noundef %49, i32 noundef %50, i32 noundef 0, i32 noundef %51)
  %52 = load i32, ptr %14, align 4, !tbaa !5
  %53 = add nsw i32 %52, 1
  store i32 %53, ptr %14, align 4, !tbaa !5
  %54 = sext i32 %52 to i64
  %55 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %54
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %55, ptr align 4 %17, i64 20, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 20, ptr %17) #8
  %56 = load i32, ptr %11, align 4, !tbaa !5
  %57 = load i32, ptr @numz, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @numz, align 4, !tbaa !5
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [100020 x i32], ptr @que, i64 0, i64 %59
  store i32 %56, ptr %60, align 4, !tbaa !5
  br label %158

61:                                               ; preds = %40
  %62 = load i32, ptr %15, align 4, !tbaa !5
  %63 = sext i32 %62 to i64
  %64 = getelementptr inbounds [50010 x i32], ptr @ans, i64 0, i64 %63
  store i32 0, ptr %64, align 4, !tbaa !5
  %65 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %66 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %65, ptr noundef nonnull align 4 dereferenceable(4) %9)
  %67 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %66, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %68 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %67, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %68, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %70 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %69, ptr noundef nonnull align 4 dereferenceable(4) %12)
  call void @llvm.lifetime.start.p0(i64 20, ptr %18) #8
  %71 = load i32, ptr %8, align 4, !tbaa !5
  %72 = load i32, ptr %10, align 4, !tbaa !5
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = sub nsw i32 %73, 1
  %75 = load i32, ptr %15, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %18, i32 noundef %71, i32 noundef %72, i32 noundef %74, i32 noundef 1, i32 noundef %75)
  %76 = load i32, ptr %14, align 4, !tbaa !5
  %77 = add nsw i32 %76, 1
  store i32 %77, ptr %14, align 4, !tbaa !5
  %78 = sext i32 %76 to i64
  %79 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %78
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %79, ptr align 4 %18, i64 20, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 20, ptr %18) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr %19) #8
  %80 = load i32, ptr %8, align 4, !tbaa !5
  %81 = load i32, ptr %10, align 4, !tbaa !5
  %82 = load i32, ptr %12, align 4, !tbaa !5
  %83 = load i32, ptr %15, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %19, i32 noundef %80, i32 noundef %81, i32 noundef %82, i32 noundef 2, i32 noundef %83)
  %84 = load i32, ptr %14, align 4, !tbaa !5
  %85 = add nsw i32 %84, 1
  store i32 %85, ptr %14, align 4, !tbaa !5
  %86 = sext i32 %84 to i64
  %87 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %86
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %87, ptr align 4 %19, i64 20, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 20, ptr %19) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr %20) #8
  %88 = load i32, ptr %8, align 4, !tbaa !5
  %89 = load i32, ptr %9, align 4, !tbaa !5
  %90 = sub nsw i32 %89, 1
  %91 = load i32, ptr %12, align 4, !tbaa !5
  %92 = load i32, ptr %15, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %20, i32 noundef %88, i32 noundef %90, i32 noundef %91, i32 noundef 1, i32 noundef %92)
  %93 = load i32, ptr %14, align 4, !tbaa !5
  %94 = add nsw i32 %93, 1
  store i32 %94, ptr %14, align 4, !tbaa !5
  %95 = sext i32 %93 to i64
  %96 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %95
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %96, ptr align 4 %20, i64 20, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 20, ptr %20) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr %21) #8
  %97 = load i32, ptr %7, align 4, !tbaa !5
  %98 = sub nsw i32 %97, 1
  %99 = load i32, ptr %9, align 4, !tbaa !5
  %100 = sub nsw i32 %99, 1
  %101 = load i32, ptr %12, align 4, !tbaa !5
  %102 = load i32, ptr %15, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %21, i32 noundef %98, i32 noundef %100, i32 noundef %101, i32 noundef 2, i32 noundef %102)
  %103 = load i32, ptr %14, align 4, !tbaa !5
  %104 = add nsw i32 %103, 1
  store i32 %104, ptr %14, align 4, !tbaa !5
  %105 = sext i32 %103 to i64
  %106 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %105
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %106, ptr align 4 %21, i64 20, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 20, ptr %21) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr %22) #8
  %107 = load i32, ptr %7, align 4, !tbaa !5
  %108 = sub nsw i32 %107, 1
  %109 = load i32, ptr %10, align 4, !tbaa !5
  %110 = load i32, ptr %12, align 4, !tbaa !5
  %111 = load i32, ptr %15, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %22, i32 noundef %108, i32 noundef %109, i32 noundef %110, i32 noundef 1, i32 noundef %111)
  %112 = load i32, ptr %14, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %14, align 4, !tbaa !5
  %114 = sext i32 %112 to i64
  %115 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %114
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %115, ptr align 4 %22, i64 20, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 20, ptr %22) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr %23) #8
  %116 = load i32, ptr %7, align 4, !tbaa !5
  %117 = sub nsw i32 %116, 1
  %118 = load i32, ptr %10, align 4, !tbaa !5
  %119 = load i32, ptr %11, align 4, !tbaa !5
  %120 = sub nsw i32 %119, 1
  %121 = load i32, ptr %15, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %23, i32 noundef %117, i32 noundef %118, i32 noundef %120, i32 noundef 2, i32 noundef %121)
  %122 = load i32, ptr %14, align 4, !tbaa !5
  %123 = add nsw i32 %122, 1
  store i32 %123, ptr %14, align 4, !tbaa !5
  %124 = sext i32 %122 to i64
  %125 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %124
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %125, ptr align 4 %23, i64 20, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 20, ptr %23) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr %24) #8
  %126 = load i32, ptr %7, align 4, !tbaa !5
  %127 = sub nsw i32 %126, 1
  %128 = load i32, ptr %9, align 4, !tbaa !5
  %129 = sub nsw i32 %128, 1
  %130 = load i32, ptr %11, align 4, !tbaa !5
  %131 = sub nsw i32 %130, 1
  %132 = load i32, ptr %15, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %24, i32 noundef %127, i32 noundef %129, i32 noundef %131, i32 noundef 1, i32 noundef %132)
  %133 = load i32, ptr %14, align 4, !tbaa !5
  %134 = add nsw i32 %133, 1
  store i32 %134, ptr %14, align 4, !tbaa !5
  %135 = sext i32 %133 to i64
  %136 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %135
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %136, ptr align 4 %24, i64 20, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 20, ptr %24) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr %25) #8
  %137 = load i32, ptr %8, align 4, !tbaa !5
  %138 = load i32, ptr %9, align 4, !tbaa !5
  %139 = sub nsw i32 %138, 1
  %140 = load i32, ptr %11, align 4, !tbaa !5
  %141 = sub nsw i32 %140, 1
  %142 = load i32, ptr %15, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %25, i32 noundef %137, i32 noundef %139, i32 noundef %141, i32 noundef 2, i32 noundef %142)
  %143 = load i32, ptr %14, align 4, !tbaa !5
  %144 = add nsw i32 %143, 1
  store i32 %144, ptr %14, align 4, !tbaa !5
  %145 = sext i32 %143 to i64
  %146 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %145
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %146, ptr align 4 %25, i64 20, i1 false), !tbaa.struct !11
  call void @llvm.lifetime.end.p0(i64 20, ptr %25) #8
  %147 = load i32, ptr %11, align 4, !tbaa !5
  %148 = sub nsw i32 %147, 1
  %149 = load i32, ptr @numz, align 4, !tbaa !5
  %150 = add nsw i32 %149, 1
  store i32 %150, ptr @numz, align 4, !tbaa !5
  %151 = sext i32 %149 to i64
  %152 = getelementptr inbounds [100020 x i32], ptr @que, i64 0, i64 %151
  store i32 %148, ptr %152, align 4, !tbaa !5
  %153 = load i32, ptr %12, align 4, !tbaa !5
  %154 = load i32, ptr @numz, align 4, !tbaa !5
  %155 = add nsw i32 %154, 1
  store i32 %155, ptr @numz, align 4, !tbaa !5
  %156 = sext i32 %154 to i64
  %157 = getelementptr inbounds [100020 x i32], ptr @que, i64 0, i64 %156
  store i32 %153, ptr %157, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %61, %44
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #8
  br label %159

159:                                              ; preds = %158
  %160 = load i32, ptr %15, align 4, !tbaa !5
  %161 = add nsw i32 %160, 1
  store i32 %161, ptr %15, align 4, !tbaa !5
  br label %35, !llvm.loop !12

162:                                              ; preds = %39
  %163 = load i32, ptr @numz, align 4, !tbaa !5
  %164 = sext i32 %163 to i64
  %165 = getelementptr inbounds i32, ptr @que, i64 %164
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %165)
  %166 = load i32, ptr @numz, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds i32, ptr @que, i64 %167
  %169 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %168)
  %170 = ptrtoint ptr %169 to i64
  %171 = sub i64 %170, ptrtoint (ptr @que to i64)
  %172 = sdiv exact i64 %171, 4
  %173 = trunc i64 %172 to i32
  store i32 %173, ptr @numz, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %174

174:                                              ; preds = %197, %162
  %175 = load i32, ptr %26, align 4, !tbaa !5
  %176 = load i32, ptr %14, align 4, !tbaa !5
  %177 = icmp slt i32 %175, %176
  br i1 %177, label %179, label %178

178:                                              ; preds = %174
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  br label %200

179:                                              ; preds = %174
  %180 = load i32, ptr @numz, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds i32, ptr @que, i64 %181
  %183 = load i32, ptr %26, align 4, !tbaa !5
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %184
  %186 = getelementptr inbounds %struct.Query, ptr %185, i32 0, i32 2
  %187 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %182, ptr noundef nonnull align 4 dereferenceable(4) %186)
  %188 = ptrtoint ptr %187 to i64
  %189 = sub i64 %188, ptrtoint (ptr @que to i64)
  %190 = sdiv exact i64 %189, 4
  %191 = add nsw i64 %190, 1
  %192 = trunc i64 %191 to i32
  %193 = load i32, ptr %26, align 4, !tbaa !5
  %194 = sext i32 %193 to i64
  %195 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %194
  %196 = getelementptr inbounds %struct.Query, ptr %195, i32 0, i32 2
  store i32 %192, ptr %196, align 4, !tbaa !14
  br label %197

197:                                              ; preds = %179
  %198 = load i32, ptr %26, align 4, !tbaa !5
  %199 = add nsw i32 %198, 1
  store i32 %199, ptr %26, align 4, !tbaa !5
  br label %174, !llvm.loop !16

200:                                              ; preds = %178
  %201 = load i32, ptr %14, align 4, !tbaa !5
  %202 = sub nsw i32 %201, 1
  call void @_Z6solve1ii(i32 noundef 0, i32 noundef %202)
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #8
  store i32 0, ptr %27, align 4, !tbaa !5
  br label %203

203:                                              ; preds = %222, %200
  %204 = load i32, ptr %27, align 4, !tbaa !5
  %205 = load i32, ptr %13, align 4, !tbaa !5
  %206 = icmp slt i32 %204, %205
  br i1 %206, label %208, label %207

207:                                              ; preds = %203
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #8
  br label %225

208:                                              ; preds = %203
  %209 = load i32, ptr %27, align 4, !tbaa !5
  %210 = sext i32 %209 to i64
  %211 = getelementptr inbounds [50010 x i32], ptr @ans, i64 0, i64 %210
  %212 = load i32, ptr %211, align 4, !tbaa !5
  %213 = icmp ne i32 %212, -1
  br i1 %213, label %214, label %221

214:                                              ; preds = %208
  %215 = load i32, ptr %27, align 4, !tbaa !5
  %216 = sext i32 %215 to i64
  %217 = getelementptr inbounds [50010 x i32], ptr @ans, i64 0, i64 %216
  %218 = load i32, ptr %217, align 4, !tbaa !5
  %219 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %218)
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %219, i8 noundef signext 10)
  br label %221

221:                                              ; preds = %214, %208
  br label %222

222:                                              ; preds = %221
  %223 = load i32, ptr %27, align 4, !tbaa !5
  %224 = add nsw i32 %223, 1
  store i32 %224, ptr %27, align 4, !tbaa !5
  br label %203, !llvm.loop !17

225:                                              ; preds = %207
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  br label %29, !llvm.loop !18

226:                                              ; preds = %29
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #8
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #6 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) #7

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) #4

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


; 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, i32 }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@que = external dso_local global [100020 x i32], align 16
@ans = external dso_local local_unnamed_addr global [50010 x i32], align 16
@numz = external dso_local local_unnamed_addr global i32, align 4
@queries = external dso_local global [400080 x %struct.Query], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main(i32 noundef %0, ptr nocapture noundef readnone %1) local_unnamed_addr #3 {
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %struct.Query, align 4
  %13 = alloca %struct.Query, align 4
  %14 = alloca %struct.Query, align 4
  %15 = alloca %struct.Query, align 4
  %16 = alloca %struct.Query, align 4
  %17 = alloca %struct.Query, align 4
  %18 = alloca %struct.Query, align 4
  %19 = alloca %struct.Query, align 4
  %20 = alloca %struct.Query, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #8
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #8
  %22 = load i32, ptr %3, align 4, !tbaa !5
  %23 = add nsw i32 %22, -1
  store i32 %23, ptr %3, align 4, !tbaa !5
  %.not46 = icmp eq i32 %22, 0
  br i1 %.not46, label %._crit_edge49, label %.lr.ph48

.lr.ph48:                                         ; preds = %2, %._crit_edge45
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(200040) @ans, i8 -1, i64 200040, i1 false)
  store i32 0, ptr @numz, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #8
  %24 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %25 = load i32, ptr %10, align 4, !tbaa !5
  %26 = icmp sgt i32 %25, 0
  br i1 %26, label %.lr.ph, label %.lr.ph48.._crit_edge_crit_edge

.lr.ph48.._crit_edge_crit_edge:                   ; preds = %.lr.ph48
  %.pre = load i32, ptr @numz, align 4, !tbaa !5
  br label %._crit_edge

._crit_edge:                                      ; preds = %131, %.lr.ph48.._crit_edge_crit_edge
  %27 = phi i32 [ %.pre, %.lr.ph48.._crit_edge_crit_edge ], [ %.sink, %131 ]
  %.033.lcssa = phi i32 [ 0, %.lr.ph48.._crit_edge_crit_edge ], [ %.1, %131 ]
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds i32, ptr @que, i64 %28
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %29)
  %30 = load i32, ptr @numz, align 4, !tbaa !5
  %31 = sext i32 %30 to i64
  %32 = getelementptr inbounds i32, ptr @que, i64 %31
  %33 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %32)
  %34 = ptrtoint ptr %33 to i64
  %35 = sub i64 %34, ptrtoint (ptr @que to i64)
  %36 = lshr exact i64 %35, 2
  %37 = trunc i64 %36 to i32
  store i32 %37, ptr @numz, align 4, !tbaa !5
  %38 = icmp sgt i32 %.033.lcssa, 0
  br i1 %38, label %.lr.ph40.preheader, label %._crit_edge41

.lr.ph40.preheader:                               ; preds = %._crit_edge
  %wide.trip.count = zext nneg i32 %.033.lcssa to i64
  br label %.lr.ph40

.lr.ph:                                           ; preds = %.lr.ph48, %131
  %indvars.iv = phi i64 [ %indvars.iv.next, %131 ], [ 0, %.lr.ph48 ]
  %.03336 = phi i32 [ %.1, %131 ], [ 0, %.lr.ph48 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %11) #8
  %39 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %11)
  %40 = load i32, ptr %11, align 4, !tbaa !5
  %41 = icmp eq i32 %40, 1
  br i1 %41, label %42, label %55

42:                                               ; preds = %.lr.ph
  %43 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %43, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %12) #8
  %46 = load i32, ptr %4, align 4, !tbaa !5
  %47 = load i32, ptr %6, align 4, !tbaa !5
  %48 = load i32, ptr %8, align 4, !tbaa !5
  %49 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %12, i32 noundef %46, i32 noundef %47, i32 noundef %48, i32 noundef 0, i32 noundef %49)
  %50 = add nsw i32 %.03336, 1
  %51 = sext i32 %.03336 to i64
  %52 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %51
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %52, ptr noundef nonnull align 4 dereferenceable(20) %12, i64 20, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %12) #8
  %53 = load i32, ptr @numz, align 4, !tbaa !5
  %54 = add nsw i32 %53, 1
  br label %131

55:                                               ; preds = %.lr.ph
  %56 = getelementptr inbounds [50010 x i32], ptr @ans, i64 0, i64 %indvars.iv
  store i32 0, ptr %56, align 4, !tbaa !5
  %57 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %58 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %57, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %58, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %60 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %59, ptr noundef nonnull align 4 dereferenceable(4) %5)
  %61 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %60, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %62 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %61, ptr noundef nonnull align 4 dereferenceable(4) %9)
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %13) #8
  %63 = load i32, ptr %5, align 4, !tbaa !5
  %64 = load i32, ptr %7, align 4, !tbaa !5
  %65 = load i32, ptr %8, align 4, !tbaa !5
  %66 = add nsw i32 %65, -1
  %67 = trunc nuw nsw i64 %indvars.iv to i32
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %13, i32 noundef %63, i32 noundef %64, i32 noundef %66, i32 noundef 1, i32 noundef %67)
  %68 = add nsw i32 %.03336, 1
  %69 = sext i32 %.03336 to i64
  %70 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %69
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %70, ptr noundef nonnull align 4 dereferenceable(20) %13, i64 20, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %13) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %14) #8
  %71 = load i32, ptr %5, align 4, !tbaa !5
  %72 = load i32, ptr %7, align 4, !tbaa !5
  %73 = load i32, ptr %9, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %14, i32 noundef %71, i32 noundef %72, i32 noundef %73, i32 noundef 2, i32 noundef %67)
  %74 = add nsw i32 %.03336, 2
  %75 = sext i32 %68 to i64
  %76 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %75
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %76, ptr noundef nonnull align 4 dereferenceable(20) %14, i64 20, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %14) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %15) #8
  %77 = load i32, ptr %5, align 4, !tbaa !5
  %78 = load i32, ptr %6, align 4, !tbaa !5
  %79 = add nsw i32 %78, -1
  %80 = load i32, ptr %9, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %15, i32 noundef %77, i32 noundef %79, i32 noundef %80, i32 noundef 1, i32 noundef %67)
  %81 = add nsw i32 %.03336, 3
  %82 = sext i32 %74 to i64
  %83 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %82
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %83, ptr noundef nonnull align 4 dereferenceable(20) %15, i64 20, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %15) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %16) #8
  %84 = load i32, ptr %4, align 4, !tbaa !5
  %85 = add nsw i32 %84, -1
  %86 = load i32, ptr %6, align 4, !tbaa !5
  %87 = add nsw i32 %86, -1
  %88 = load i32, ptr %9, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %16, i32 noundef %85, i32 noundef %87, i32 noundef %88, i32 noundef 2, i32 noundef %67)
  %89 = add nsw i32 %.03336, 4
  %90 = sext i32 %81 to i64
  %91 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %90
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %91, ptr noundef nonnull align 4 dereferenceable(20) %16, i64 20, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %16) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %17) #8
  %92 = load i32, ptr %4, align 4, !tbaa !5
  %93 = add nsw i32 %92, -1
  %94 = load i32, ptr %7, align 4, !tbaa !5
  %95 = load i32, ptr %9, align 4, !tbaa !5
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %17, i32 noundef %93, i32 noundef %94, i32 noundef %95, i32 noundef 1, i32 noundef %67)
  %96 = add nsw i32 %.03336, 5
  %97 = sext i32 %89 to i64
  %98 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %97
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %98, ptr noundef nonnull align 4 dereferenceable(20) %17, i64 20, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %17) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %18) #8
  %99 = load i32, ptr %4, align 4, !tbaa !5
  %100 = add nsw i32 %99, -1
  %101 = load i32, ptr %7, align 4, !tbaa !5
  %102 = load i32, ptr %8, align 4, !tbaa !5
  %103 = add nsw i32 %102, -1
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %18, i32 noundef %100, i32 noundef %101, i32 noundef %103, i32 noundef 2, i32 noundef %67)
  %104 = add nsw i32 %.03336, 6
  %105 = sext i32 %96 to i64
  %106 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %105
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %106, ptr noundef nonnull align 4 dereferenceable(20) %18, i64 20, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %18) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %19) #8
  %107 = load i32, ptr %4, align 4, !tbaa !5
  %108 = add nsw i32 %107, -1
  %109 = load i32, ptr %6, align 4, !tbaa !5
  %110 = add nsw i32 %109, -1
  %111 = load i32, ptr %8, align 4, !tbaa !5
  %112 = add nsw i32 %111, -1
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %19, i32 noundef %108, i32 noundef %110, i32 noundef %112, i32 noundef 1, i32 noundef %67)
  %113 = add nsw i32 %.03336, 7
  %114 = sext i32 %104 to i64
  %115 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %114
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %115, ptr noundef nonnull align 4 dereferenceable(20) %19, i64 20, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %19) #8
  call void @llvm.lifetime.start.p0(i64 20, ptr nonnull %20) #8
  %116 = load i32, ptr %5, align 4, !tbaa !5
  %117 = load i32, ptr %6, align 4, !tbaa !5
  %118 = add nsw i32 %117, -1
  %119 = load i32, ptr %8, align 4, !tbaa !5
  %120 = add nsw i32 %119, -1
  call void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20) %20, i32 noundef %116, i32 noundef %118, i32 noundef %120, i32 noundef 2, i32 noundef %67)
  %121 = add nsw i32 %.03336, 8
  %122 = sext i32 %113 to i64
  %123 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %122
  call void @llvm.memcpy.p0.p0.i64(ptr noundef nonnull align 4 dereferenceable(20) %123, ptr noundef nonnull align 4 dereferenceable(20) %20, i64 20, i1 false), !tbaa.struct !9
  call void @llvm.lifetime.end.p0(i64 20, ptr nonnull %20) #8
  %124 = load i32, ptr %8, align 4, !tbaa !5
  %125 = add nsw i32 %124, -1
  %126 = load i32, ptr @numz, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  %128 = sext i32 %126 to i64
  %129 = getelementptr inbounds [100020 x i32], ptr @que, i64 0, i64 %128
  store i32 %125, ptr %129, align 4, !tbaa !5
  %130 = add nsw i32 %126, 2
  br label %131

131:                                              ; preds = %55, %42
  %.sink61 = phi i32 [ %127, %55 ], [ %53, %42 ]
  %.sink58.in = phi ptr [ %9, %55 ], [ %8, %42 ]
  %.sink = phi i32 [ %130, %55 ], [ %54, %42 ]
  %.1 = phi i32 [ %121, %55 ], [ %50, %42 ]
  %.sink58 = load i32, ptr %.sink58.in, align 4, !tbaa !5
  %132 = sext i32 %.sink61 to i64
  %133 = getelementptr inbounds [100020 x i32], ptr @que, i64 0, i64 %132
  store i32 %.sink58, ptr %133, align 4, !tbaa !5
  store i32 %.sink, ptr @numz, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %11) #8
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %134 = load i32, ptr %10, align 4, !tbaa !5
  %135 = sext i32 %134 to i64
  %136 = icmp slt i64 %indvars.iv.next, %135
  br i1 %136, label %.lr.ph, label %._crit_edge, !llvm.loop !10

._crit_edge41:                                    ; preds = %.lr.ph40, %._crit_edge
  %137 = add nsw i32 %.033.lcssa, -1
  call void @_Z6solve1ii(i32 noundef 0, i32 noundef %137)
  %138 = load i32, ptr %10, align 4, !tbaa !5
  %139 = icmp sgt i32 %138, 0
  br i1 %139, label %.lr.ph44, label %._crit_edge45

.lr.ph40:                                         ; preds = %.lr.ph40.preheader, %.lr.ph40
  %indvars.iv51 = phi i64 [ 0, %.lr.ph40.preheader ], [ %indvars.iv.next52, %.lr.ph40 ]
  %140 = load i32, ptr @numz, align 4, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds i32, ptr @que, i64 %141
  %143 = getelementptr inbounds [400080 x %struct.Query], ptr @queries, i64 0, i64 %indvars.iv51, i32 2
  %144 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %142, ptr noundef nonnull align 4 dereferenceable(4) %143)
  %145 = ptrtoint ptr %144 to i64
  %146 = sub i64 %145, ptrtoint (ptr @que to i64)
  %147 = lshr exact i64 %146, 2
  %148 = trunc i64 %147 to i32
  %149 = add i32 %148, 1
  store i32 %149, ptr %143, align 4, !tbaa !12
  %indvars.iv.next52 = add nuw nsw i64 %indvars.iv51, 1
  %exitcond.not = icmp eq i64 %indvars.iv.next52, %wide.trip.count
  br i1 %exitcond.not, label %._crit_edge41, label %.lr.ph40, !llvm.loop !14

._crit_edge45:                                    ; preds = %158, %._crit_edge41
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #8
  %150 = load i32, ptr %3, align 4, !tbaa !5
  %151 = add nsw i32 %150, -1
  store i32 %151, ptr %3, align 4, !tbaa !5
  %.not = icmp eq i32 %150, 0
  br i1 %.not, label %._crit_edge49, label %.lr.ph48, !llvm.loop !15

.lr.ph44:                                         ; preds = %._crit_edge41, %158
  %152 = phi i32 [ %159, %158 ], [ %138, %._crit_edge41 ]
  %indvars.iv54 = phi i64 [ %indvars.iv.next55, %158 ], [ 0, %._crit_edge41 ]
  %153 = getelementptr inbounds [50010 x i32], ptr @ans, i64 0, i64 %indvars.iv54
  %154 = load i32, ptr %153, align 4, !tbaa !5
  %.not35 = icmp eq i32 %154, -1
  br i1 %.not35, label %158, label %155

155:                                              ; preds = %.lr.ph44
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %154)
  %157 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %156, i8 noundef signext 10)
  %.pre57 = load i32, ptr %10, align 4, !tbaa !5
  br label %158

158:                                              ; preds = %.lr.ph44, %155
  %159 = phi i32 [ %152, %.lr.ph44 ], [ %.pre57, %155 ]
  %indvars.iv.next55 = add nuw nsw i64 %indvars.iv54, 1
  %160 = sext i32 %159 to i64
  %161 = icmp slt i64 %indvars.iv.next55, %160
  br i1 %161, label %.lr.ph44, label %._crit_edge45, !llvm.loop !16

._crit_edge49:                                    ; preds = %._crit_edge45, %2
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %5) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #8
  ret i32 0
}

declare noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4)) local_unnamed_addr #4

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZN5QueryC2Eiiiii(ptr noundef nonnull align 4 dereferenceable(20), i32 noundef, i32 noundef, i32 noundef, i32 noundef, i32 noundef) unnamed_addr #6 align 2

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8), i8 noundef signext) local_unnamed_addr #7

declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8), i32 noundef) local_unnamed_addr #4

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


; Effective O3 passes: DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,MergedLoadStoreMotionPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass