; LLVM IR from tangjz/acm-icpc :: codeforces/complete/938G.ll (Z5solveiii)

; 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.std::pair" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"struct.std::pair.0" = type { %"struct.std::pair", i32 }

@htot = external dso_local global i32, align 4
@dsu = external dso_local global [200001 x i32], align 16
@msk = external dso_local global [200001 x i32], align 16
@que = external dso_local global [200001 x %"struct.std::pair"], align 16
@his = external dso_local global [400003 x %"struct.std::pair"], align 16
@base = external dso_local global [19 x [31 x i32]], align 16
@e = external dso_local global [400003 x %"class.std::vector"], align 16

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z8dsu_findi(i32 noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solveiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) #0 {
  %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 %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair", align 4
  %19 = alloca %"struct.std::pair", align 4
  %20 = alloca i32, align 4
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca ptr, align 8
  store i32 %0, ptr %4, align 4, !tbaa !5
  store i32 %1, ptr %5, align 4, !tbaa !5
  store i32 %2, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #5
  %24 = load i32, ptr %5, align 4, !tbaa !5
  %25 = load i32, ptr %6, align 4, !tbaa !5
  %26 = add nsw i32 %24, %25
  %27 = load i32, ptr %5, align 4, !tbaa !5
  %28 = load i32, ptr %6, align 4, !tbaa !5
  %29 = icmp slt i32 %27, %28
  %30 = zext i1 %29 to i32
  %31 = or i32 %26, %30
  store i32 %31, ptr %7, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #5
  %32 = load i32, ptr @htot, align 4, !tbaa !5
  store i32 %32, ptr %8, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #5
  %33 = load i32, ptr %7, align 4, !tbaa !5
  %34 = sext i32 %33 to i64
  %35 = getelementptr inbounds [400003 x %"class.std::vector"], ptr @e, i64 0, i64 %34
  %36 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %35) #5
  %37 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %9, i32 0, i32 0
  store ptr %36, ptr %37, align 8
  br label %38

38:                                               ; preds = %142, %3
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #5
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = sext i32 %39 to i64
  %41 = getelementptr inbounds [400003 x %"class.std::vector"], ptr @e, i64 0, i64 %40
  %42 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %41) #5
  %43 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %10, i32 0, i32 0
  store ptr %42, ptr %43, align 8
  %44 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #5
  br i1 %44, label %46, label %45

45:                                               ; preds = %38
  store i32 2, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #5
  br label %144

46:                                               ; preds = %38
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #5
  %47 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %48 = getelementptr inbounds %"struct.std::pair.0", ptr %47, i32 0, i32 0
  %49 = getelementptr inbounds %"struct.std::pair", ptr %48, i32 0, i32 0
  %50 = load i32, ptr %49, align 4, !tbaa !9
  %51 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %52 = getelementptr inbounds %"struct.std::pair.0", ptr %51, i32 0, i32 0
  %53 = getelementptr inbounds %"struct.std::pair", ptr %52, i32 0, i32 1
  %54 = load i32, ptr %53, align 4, !tbaa !12
  %55 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  %56 = getelementptr inbounds %"struct.std::pair.0", ptr %55, i32 0, i32 1
  %57 = load i32, ptr %56, align 4, !tbaa !13
  %58 = call noundef i32 @_Z9dsu_mergeiii(i32 noundef %50, i32 noundef %54, i32 noundef %57)
  store i32 %58, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 1, ptr %13, align 4, !tbaa !5
  br label %59

59:                                               ; preds = %85, %46
  %60 = load i32, ptr %13, align 4, !tbaa !5
  %61 = load i32, ptr %4, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %63 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %62
  %64 = getelementptr inbounds [31 x i32], ptr %63, i64 0, i64 0
  %65 = load i32, ptr %64, align 4, !tbaa !5
  %66 = icmp sle i32 %60, %65
  br i1 %66, label %67, label %70

67:                                               ; preds = %59
  %68 = load i32, ptr %12, align 4, !tbaa !5
  %69 = icmp ne i32 %68, 0
  br label %70

70:                                               ; preds = %67, %59
  %71 = phi i1 [ false, %59 ], [ %69, %67 ]
  br i1 %71, label %73, label %72

72:                                               ; preds = %70
  store i32 5, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %88

73:                                               ; preds = %70
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #5
  %74 = load i32, ptr %12, align 4, !tbaa !5
  %75 = load i32, ptr %4, align 4, !tbaa !5
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %76
  %78 = load i32, ptr %13, align 4, !tbaa !5
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [31 x i32], ptr %77, i64 0, i64 %79
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = xor i32 %74, %81
  store i32 %82, ptr %14, align 4, !tbaa !5
  %83 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %14)
  %84 = load i32, ptr %83, align 4, !tbaa !5
  store i32 %84, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #5
  br label %85

85:                                               ; preds = %73
  %86 = load i32, ptr %13, align 4, !tbaa !5
  %87 = add nsw i32 %86, 1
  store i32 %87, ptr %13, align 4, !tbaa !5
  br label %59, !llvm.loop !14

88:                                               ; preds = %72
  %89 = load i32, ptr %12, align 4, !tbaa !5
  %90 = icmp ne i32 %89, 0
  br i1 %90, label %91, label %141

91:                                               ; preds = %88
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #5
  store i32 1, ptr %15, align 4, !tbaa !5
  br label %92

92:                                               ; preds = %125, %91
  %93 = load i32, ptr %15, align 4, !tbaa !5
  %94 = load i32, ptr %4, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %95
  %97 = getelementptr inbounds [31 x i32], ptr %96, i64 0, i64 0
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = icmp sle i32 %93, %98
  br i1 %99, label %101, label %100

100:                                              ; preds = %92
  store i32 8, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #5
  br label %128

101:                                              ; preds = %92
  %102 = load i32, ptr %4, align 4, !tbaa !5
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %103
  %105 = load i32, ptr %15, align 4, !tbaa !5
  %106 = sext i32 %105 to i64
  %107 = getelementptr inbounds [31 x i32], ptr %104, i64 0, i64 %106
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #5
  %108 = load i32, ptr %12, align 4, !tbaa !5
  %109 = load i32, ptr %4, align 4, !tbaa !5
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %110
  %112 = load i32, ptr %15, align 4, !tbaa !5
  %113 = sext i32 %112 to i64
  %114 = getelementptr inbounds [31 x i32], ptr %111, i64 0, i64 %113
  %115 = load i32, ptr %114, align 4, !tbaa !5
  %116 = xor i32 %108, %115
  store i32 %116, ptr %16, align 4, !tbaa !5
  %117 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %107, ptr noundef nonnull align 4 dereferenceable(4) %16)
  %118 = load i32, ptr %117, align 4, !tbaa !5
  %119 = load i32, ptr %4, align 4, !tbaa !5
  %120 = sext i32 %119 to i64
  %121 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %120
  %122 = load i32, ptr %15, align 4, !tbaa !5
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [31 x i32], ptr %121, i64 0, i64 %123
  store i32 %118, ptr %124, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #5
  br label %125

125:                                              ; preds = %101
  %126 = load i32, ptr %15, align 4, !tbaa !5
  %127 = add nsw i32 %126, 1
  store i32 %127, ptr %15, align 4, !tbaa !5
  br label %92, !llvm.loop !16

128:                                              ; preds = %100
  %129 = load i32, ptr %12, align 4, !tbaa !5
  %130 = load i32, ptr %4, align 4, !tbaa !5
  %131 = sext i32 %130 to i64
  %132 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %131
  %133 = load i32, ptr %4, align 4, !tbaa !5
  %134 = sext i32 %133 to i64
  %135 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %134
  %136 = getelementptr inbounds [31 x i32], ptr %135, i64 0, i64 0
  %137 = load i32, ptr %136, align 4, !tbaa !5
  %138 = add nsw i32 %137, 1
  store i32 %138, ptr %136, align 4, !tbaa !5
  %139 = sext i32 %138 to i64
  %140 = getelementptr inbounds [31 x i32], ptr %132, i64 0, i64 %139
  store i32 %129, ptr %140, align 4, !tbaa !5
  br label %141

141:                                              ; preds = %128, %88
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %142

142:                                              ; preds = %141
  %143 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #5
  br label %38, !llvm.loop !17

144:                                              ; preds = %45
  %145 = load i32, ptr %5, align 4, !tbaa !5
  %146 = load i32, ptr %6, align 4, !tbaa !5
  %147 = icmp eq i32 %145, %146
  br i1 %147, label %148, label %196

148:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #5
  %149 = load i32, ptr %5, align 4, !tbaa !5
  %150 = sext i32 %149 to i64
  %151 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @que, i64 0, i64 %150
  %152 = getelementptr inbounds %"struct.std::pair", ptr %151, i32 0, i32 0
  %153 = load i32, ptr %152, align 8, !tbaa !18
  %154 = call i64 @_Z8dsu_findi(i32 noundef %153)
  store i64 %154, ptr %18, align 4
  %155 = getelementptr inbounds %"struct.std::pair", ptr %18, i32 0, i32 1
  %156 = load i32, ptr %155, align 4, !tbaa !19
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #5
  %157 = load i32, ptr %5, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @que, i64 0, i64 %158
  %160 = getelementptr inbounds %"struct.std::pair", ptr %159, i32 0, i32 1
  %161 = load i32, ptr %160, align 4, !tbaa !19
  %162 = call i64 @_Z8dsu_findi(i32 noundef %161)
  store i64 %162, ptr %19, align 4
  %163 = getelementptr inbounds %"struct.std::pair", ptr %19, i32 0, i32 1
  %164 = load i32, ptr %163, align 4, !tbaa !19
  %165 = xor i32 %156, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #5
  store i32 %165, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %20) #5
  store i32 1, ptr %20, align 4, !tbaa !5
  br label %166

166:                                              ; preds = %187, %148
  %167 = load i32, ptr %20, align 4, !tbaa !5
  %168 = load i32, ptr %4, align 4, !tbaa !5
  %169 = sext i32 %168 to i64
  %170 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %169
  %171 = getelementptr inbounds [31 x i32], ptr %170, i64 0, i64 0
  %172 = load i32, ptr %171, align 4, !tbaa !5
  %173 = icmp sle i32 %167, %172
  br i1 %173, label %175, label %174

174:                                              ; preds = %166
  store i32 11, ptr %11, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %20) #5
  br label %190

175:                                              ; preds = %166
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  %176 = load i32, ptr %17, align 4, !tbaa !5
  %177 = load i32, ptr %4, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %178
  %180 = load i32, ptr %20, align 4, !tbaa !5
  %181 = sext i32 %180 to i64
  %182 = getelementptr inbounds [31 x i32], ptr %179, i64 0, i64 %181
  %183 = load i32, ptr %182, align 4, !tbaa !5
  %184 = xor i32 %176, %183
  store i32 %184, ptr %21, align 4, !tbaa !5
  %185 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 4 dereferenceable(4) %21)
  %186 = load i32, ptr %185, align 4, !tbaa !5
  store i32 %186, ptr %17, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  br label %187

187:                                              ; preds = %175
  %188 = load i32, ptr %20, align 4, !tbaa !5
  %189 = add nsw i32 %188, 1
  store i32 %189, ptr %20, align 4, !tbaa !5
  br label %166, !llvm.loop !20

190:                                              ; preds = %174
  %191 = load i32, ptr %17, align 4, !tbaa !5
  %192 = load i32, ptr %5, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @que, i64 0, i64 %193
  %195 = getelementptr inbounds %"struct.std::pair", ptr %194, i32 0, i32 0
  store i32 %191, ptr %195, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #5
  br label %244

196:                                              ; preds = %144
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  %197 = load i32, ptr %5, align 4, !tbaa !5
  %198 = load i32, ptr %6, align 4, !tbaa !5
  %199 = add nsw i32 %197, %198
  %200 = ashr i32 %199, 1
  store i32 %200, ptr %22, align 4, !tbaa !5
  %201 = load i32, ptr %4, align 4, !tbaa !5
  %202 = add nsw i32 %201, 1
  %203 = sext i32 %202 to i64
  %204 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %203
  %205 = getelementptr inbounds [31 x i32], ptr %204, i64 0, i64 0
  %206 = load i32, ptr %4, align 4, !tbaa !5
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %207
  %209 = getelementptr inbounds [31 x i32], ptr %208, i64 0, i64 0
  %210 = load i32, ptr %4, align 4, !tbaa !5
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %211
  %213 = getelementptr inbounds [31 x i32], ptr %212, i64 0, i64 0
  %214 = load i32, ptr %213, align 4, !tbaa !5
  %215 = add nsw i32 %214, 1
  %216 = sext i32 %215 to i64
  %217 = mul i64 %216, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %205, ptr align 4 %209, i64 %217, i1 false)
  %218 = load i32, ptr %4, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  %220 = load i32, ptr %5, align 4, !tbaa !5
  %221 = load i32, ptr %22, align 4, !tbaa !5
  call void @_Z5solveiii(i32 noundef %219, i32 noundef %220, i32 noundef %221)
  %222 = load i32, ptr %4, align 4, !tbaa !5
  %223 = add nsw i32 %222, 1
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %224
  %226 = getelementptr inbounds [31 x i32], ptr %225, i64 0, i64 0
  %227 = load i32, ptr %4, align 4, !tbaa !5
  %228 = sext i32 %227 to i64
  %229 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %228
  %230 = getelementptr inbounds [31 x i32], ptr %229, i64 0, i64 0
  %231 = load i32, ptr %4, align 4, !tbaa !5
  %232 = sext i32 %231 to i64
  %233 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %232
  %234 = getelementptr inbounds [31 x i32], ptr %233, i64 0, i64 0
  %235 = load i32, ptr %234, align 4, !tbaa !5
  %236 = add nsw i32 %235, 1
  %237 = sext i32 %236 to i64
  %238 = mul i64 %237, 4
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %226, ptr align 4 %230, i64 %238, i1 false)
  %239 = load i32, ptr %4, align 4, !tbaa !5
  %240 = add nsw i32 %239, 1
  %241 = load i32, ptr %22, align 4, !tbaa !5
  %242 = add nsw i32 %241, 1
  %243 = load i32, ptr %6, align 4, !tbaa !5
  call void @_Z5solveiii(i32 noundef %240, i32 noundef %242, i32 noundef %243)
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  br label %244

244:                                              ; preds = %196, %190
  br label %245

245:                                              ; preds = %249, %244
  %246 = load i32, ptr @htot, align 4, !tbaa !5
  %247 = load i32, ptr %8, align 4, !tbaa !5
  %248 = icmp sgt i32 %246, %247
  br i1 %248, label %249, label %281

249:                                              ; preds = %245
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #5
  %250 = load i32, ptr @htot, align 4, !tbaa !5
  %251 = add nsw i32 %250, -1
  store i32 %251, ptr @htot, align 4, !tbaa !5
  %252 = sext i32 %251 to i64
  %253 = getelementptr inbounds [400003 x %"struct.std::pair"], ptr @his, i64 0, i64 %252
  store ptr %253, ptr %23, align 8, !tbaa !21
  %254 = load ptr, ptr %23, align 8, !tbaa !21
  %255 = getelementptr inbounds %"struct.std::pair", ptr %254, i32 0, i32 1
  %256 = load i32, ptr %255, align 4, !tbaa !19
  %257 = load ptr, ptr %23, align 8, !tbaa !21
  %258 = getelementptr inbounds %"struct.std::pair", ptr %257, i32 0, i32 0
  %259 = load i32, ptr %258, align 4, !tbaa !18
  %260 = sext i32 %259 to i64
  %261 = getelementptr inbounds [200001 x i32], ptr @dsu, i64 0, i64 %260
  store i32 %256, ptr %261, align 4, !tbaa !5
  %262 = load i32, ptr @htot, align 4, !tbaa !5
  %263 = add nsw i32 %262, -1
  store i32 %263, ptr @htot, align 4, !tbaa !5
  %264 = sext i32 %263 to i64
  %265 = getelementptr inbounds [400003 x %"struct.std::pair"], ptr @his, i64 0, i64 %264
  %266 = load ptr, ptr %23, align 8, !tbaa !21
  %267 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %266, ptr noundef nonnull align 4 dereferenceable(8) %265)
  %268 = load ptr, ptr %23, align 8, !tbaa !21
  %269 = getelementptr inbounds %"struct.std::pair", ptr %268, i32 0, i32 1
  %270 = load i32, ptr %269, align 4, !tbaa !19
  %271 = load ptr, ptr %23, align 8, !tbaa !21
  %272 = getelementptr inbounds %"struct.std::pair", ptr %271, i32 0, i32 0
  %273 = load i32, ptr %272, align 4, !tbaa !18
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [200001 x i32], ptr @dsu, i64 0, i64 %274
  store i32 %270, ptr %275, align 4, !tbaa !5
  %276 = load ptr, ptr %23, align 8, !tbaa !21
  %277 = getelementptr inbounds %"struct.std::pair", ptr %276, i32 0, i32 0
  %278 = load i32, ptr %277, align 4, !tbaa !18
  %279 = sext i32 %278 to i64
  %280 = getelementptr inbounds [200001 x i32], ptr @msk, i64 0, i64 %279
  store i32 0, ptr %280, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #5
  br label %245, !llvm.loop !23

281:                                              ; preds = %245
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #5
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) #3 align 2

; 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)) #3 align 2

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


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

%"struct.std::pair" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::pair<std::pair<int, int>, int>, std::allocator<std::pair<std::pair<int, int>, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }

@htot = external dso_local local_unnamed_addr global i32, align 4
@dsu = external dso_local local_unnamed_addr global [200001 x i32], align 16
@msk = external dso_local local_unnamed_addr global [200001 x i32], align 16
@que = external dso_local local_unnamed_addr global [200001 x %"struct.std::pair"], align 16
@his = external dso_local global [400003 x %"struct.std::pair"], align 16
@base = external dso_local global [19 x [31 x i32]], align 16
@e = external dso_local global [400003 x %"class.std::vector"], align 16

; Function Attrs: mustprogress uwtable
declare dso_local i64 @_Z8dsu_findi(i32 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solveiii(i32 noundef %0, i32 noundef %1, i32 noundef %2) local_unnamed_addr #0 {
  %4 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %5 = alloca %"class.__gnu_cxx::__normal_iterator", 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 = add nsw i32 %2, %1
  %12 = icmp slt i32 %1, %2
  %13 = zext i1 %12 to i32
  %14 = or i32 %11, %13
  %15 = load i32, ptr @htot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %4) #5
  %16 = sext i32 %14 to i64
  %17 = getelementptr inbounds [400003 x %"class.std::vector"], ptr @e, i64 0, i64 %16
  %18 = tail call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  store ptr %18, ptr %4, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %19 = tail call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  store ptr %19, ptr %5, align 8
  %20 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %20, label %.lr.ph74, label %._crit_edge75

.lr.ph74:                                         ; preds = %3
  %21 = sext i32 %0 to i64
  %22 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %21
  br label %24

._crit_edge75:                                    ; preds = %63, %3
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %4) #5
  %23 = icmp eq i32 %1, %2
  br i1 %23, label %67, label %89

24:                                               ; preds = %.lr.ph74, %63
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #5
  %25 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %26 = load i32, ptr %25, align 4, !tbaa !9
  %27 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %28 = getelementptr inbounds i8, ptr %27, i64 4
  %29 = load i32, ptr %28, align 4, !tbaa !12
  %30 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  %31 = getelementptr inbounds i8, ptr %30, i64 8
  %32 = load i32, ptr %31, align 4, !tbaa !13
  %33 = call noundef i32 @_Z9dsu_mergeiii(i32 noundef %26, i32 noundef %29, i32 noundef %32)
  store i32 %33, ptr %6, align 4, !tbaa !5
  %34 = load i32, ptr %22, align 4, !tbaa !5
  %35 = icmp sgt i32 %34, 0
  %36 = icmp ne i32 %33, 0
  %37 = and i1 %35, %36
  br i1 %37, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %.lr.ph, %24
  %38 = phi i32 [ %33, %24 ], [ %45, %.lr.ph ]
  %39 = phi i32 [ %34, %24 ], [ %46, %.lr.ph ]
  %.lcssa = phi i1 [ %36, %24 ], [ %49, %.lr.ph ]
  br i1 %.lcssa, label %.preheader, label %63

.preheader:                                       ; preds = %._crit_edge
  %.not6168 = icmp slt i32 %39, 1
  br i1 %.not6168, label %._crit_edge71, label %.lr.ph70

.lr.ph:                                           ; preds = %24, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %24 ]
  %40 = phi i32 [ %45, %.lr.ph ], [ %33, %24 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #5
  %41 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %21, i64 %indvars.iv
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %43 = xor i32 %42, %40
  store i32 %43, ptr %7, align 4, !tbaa !5
  %44 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %6, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %45 = load i32, ptr %44, align 4, !tbaa !5
  store i32 %45, ptr %6, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %46 = load i32, ptr %22, align 4, !tbaa !5
  %47 = sext i32 %46 to i64
  %48 = icmp slt i64 %indvars.iv, %47
  %49 = icmp ne i32 %45, 0
  %50 = select i1 %48, i1 %49, i1 false
  br i1 %50, label %.lr.ph, label %._crit_edge, !llvm.loop !14

._crit_edge71.loopexit:                           ; preds = %.lr.ph70
  %.pre = load i32, ptr %6, align 4, !tbaa !5
  br label %._crit_edge71

._crit_edge71:                                    ; preds = %._crit_edge71.loopexit, %.preheader
  %51 = phi i32 [ %38, %.preheader ], [ %.pre, %._crit_edge71.loopexit ]
  %.lcssa64 = phi i32 [ %39, %.preheader ], [ %61, %._crit_edge71.loopexit ]
  %52 = add nsw i32 %.lcssa64, 1
  store i32 %52, ptr %22, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %21, i64 %53
  store i32 %51, ptr %54, align 4, !tbaa !5
  br label %63

.lr.ph70:                                         ; preds = %.preheader, %.lr.ph70
  %indvars.iv87 = phi i64 [ %indvars.iv.next88, %.lr.ph70 ], [ 1, %.preheader ]
  %55 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %21, i64 %indvars.iv87
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #5
  %56 = load i32, ptr %6, align 4, !tbaa !5
  %57 = load i32, ptr %55, align 4, !tbaa !5
  %58 = xor i32 %57, %56
  store i32 %58, ptr %8, align 4, !tbaa !5
  %59 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %55, ptr noundef nonnull align 4 dereferenceable(4) %8)
  %60 = load i32, ptr %59, align 4, !tbaa !5
  store i32 %60, ptr %55, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #5
  %indvars.iv.next88 = add nuw nsw i64 %indvars.iv87, 1
  %61 = load i32, ptr %22, align 4, !tbaa !5
  %62 = sext i32 %61 to i64
  %.not61.not = icmp slt i64 %indvars.iv87, %62
  br i1 %.not61.not, label %.lr.ph70, label %._crit_edge71.loopexit, !llvm.loop !16

63:                                               ; preds = %._crit_edge71, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #5
  %64 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %4) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #5
  %65 = call ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %17) #5
  store ptr %65, ptr %5, align 8
  %66 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %4, ptr noundef nonnull align 8 dereferenceable(8) %5) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #5
  br i1 %66, label %24, label %._crit_edge75, !llvm.loop !17

67:                                               ; preds = %._crit_edge75
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %9) #5
  %68 = sext i32 %2 to i64
  %69 = getelementptr inbounds [200001 x %"struct.std::pair"], ptr @que, i64 0, i64 %68
  %70 = load i32, ptr %69, align 8, !tbaa !18
  %71 = call i64 @_Z8dsu_findi(i32 noundef %70)
  %72 = getelementptr inbounds i8, ptr %69, i64 4
  %73 = load i32, ptr %72, align 4, !tbaa !19
  %74 = call i64 @_Z8dsu_findi(i32 noundef %73)
  %.sroa.311.0.extract.shift60 = xor i64 %74, %71
  %75 = lshr i64 %.sroa.311.0.extract.shift60, 32
  %76 = trunc nuw i64 %75 to i32
  store i32 %76, ptr %9, align 4, !tbaa !5
  %77 = sext i32 %0 to i64
  %78 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %77
  %79 = load i32, ptr %78, align 4, !tbaa !5
  %.not76 = icmp slt i32 %79, 1
  br i1 %.not76, label %._crit_edge80, label %.lr.ph79

._crit_edge80:                                    ; preds = %.lr.ph79, %67
  %80 = phi i32 [ %76, %67 ], [ %86, %.lr.ph79 ]
  store i32 %80, ptr %69, align 8, !tbaa !18
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %9) #5
  br label %105

.lr.ph79:                                         ; preds = %67, %.lr.ph79
  %81 = phi i32 [ %86, %.lr.ph79 ], [ %76, %67 ]
  %indvars.iv90 = phi i64 [ %indvars.iv.next91, %.lr.ph79 ], [ 1, %67 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %10) #5
  %82 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %77, i64 %indvars.iv90
  %83 = load i32, ptr %82, align 4, !tbaa !5
  %84 = xor i32 %83, %81
  store i32 %84, ptr %10, align 4, !tbaa !5
  %85 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3minIiERKT_S2_S2_(ptr noundef nonnull align 4 dereferenceable(4) %9, ptr noundef nonnull align 4 dereferenceable(4) %10)
  %86 = load i32, ptr %85, align 4, !tbaa !5
  store i32 %86, ptr %9, align 4, !tbaa !5
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %10) #5
  %indvars.iv.next91 = add nuw nsw i64 %indvars.iv90, 1
  %87 = load i32, ptr %78, align 4, !tbaa !5
  %88 = sext i32 %87 to i64
  %.not.not = icmp slt i64 %indvars.iv90, %88
  br i1 %.not.not, label %.lr.ph79, label %._crit_edge80, !llvm.loop !20

89:                                               ; preds = %._crit_edge75
  %90 = ashr i32 %11, 1
  %91 = add nsw i32 %0, 1
  %92 = sext i32 %91 to i64
  %93 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %92
  %94 = sext i32 %0 to i64
  %95 = getelementptr inbounds [19 x [31 x i32]], ptr @base, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = add nsw i32 %96, 1
  %98 = sext i32 %97 to i64
  %99 = shl nsw i64 %98, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %93, ptr nonnull align 4 %95, i64 %99, i1 false)
  call void @_Z5solveiii(i32 noundef %91, i32 noundef %1, i32 noundef %90)
  %100 = load i32, ptr %95, align 4, !tbaa !5
  %101 = add nsw i32 %100, 1
  %102 = sext i32 %101 to i64
  %103 = shl nsw i64 %102, 2
  call void @llvm.memcpy.p0.p0.i64(ptr nonnull align 4 %93, ptr nonnull align 4 %95, i64 %103, i1 false)
  %104 = add nsw i32 %90, 1
  call void @_Z5solveiii(i32 noundef %91, i32 noundef %104, i32 noundef %2)
  br label %105

105:                                              ; preds = %89, %._crit_edge80
  %106 = load i32, ptr @htot, align 4, !tbaa !5
  %107 = icmp sgt i32 %106, %15
  br i1 %107, label %.lr.ph82, label %._crit_edge83

.lr.ph82:                                         ; preds = %105, %.lr.ph82
  %108 = phi i32 [ %126, %.lr.ph82 ], [ %106, %105 ]
  %109 = add nsw i32 %108, -1
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [400003 x %"struct.std::pair"], ptr @his, i64 0, i64 %110
  %112 = getelementptr inbounds i8, ptr %111, i64 4
  %113 = load i32, ptr %112, align 4, !tbaa !19
  %114 = load i32, ptr %111, align 8, !tbaa !18
  %115 = sext i32 %114 to i64
  %116 = getelementptr inbounds [200001 x i32], ptr @dsu, i64 0, i64 %115
  store i32 %113, ptr %116, align 4, !tbaa !5
  %117 = add nsw i32 %108, -2
  store i32 %117, ptr @htot, align 4, !tbaa !5
  %118 = sext i32 %117 to i64
  %119 = getelementptr inbounds [400003 x %"struct.std::pair"], ptr @his, i64 0, i64 %118
  %120 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSERKS0_(ptr noundef nonnull align 4 dereferenceable(8) %111, ptr noundef nonnull align 4 dereferenceable(8) %119)
  %121 = load i32, ptr %112, align 4, !tbaa !19
  %122 = load i32, ptr %111, align 8, !tbaa !18
  %123 = sext i32 %122 to i64
  %124 = getelementptr inbounds [200001 x i32], ptr @dsu, i64 0, i64 %123
  store i32 %121, ptr %124, align 4, !tbaa !5
  %125 = getelementptr inbounds [200001 x i32], ptr @msk, i64 0, i64 %123
  store i32 0, ptr %125, align 4, !tbaa !5
  %126 = load i32, ptr @htot, align 4, !tbaa !5
  %127 = icmp sgt i32 %126, %15
  br i1 %127, label %.lr.ph82, label %._crit_edge83, !llvm.loop !21

._crit_edge83:                                    ; preds = %.lr.ph82, %105
  ret void
}

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt4pairIS0_IiiEiESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24)) local_unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIS1_IiiEiESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8)) local_unnamed_addr #3 align 2

; 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 #3 align 2

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


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