; LLVM IR from tangjz/acm-icpc :: uvalive/5873.ll (Z5solveiPiS_iS_)

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

@tot = external dso_local global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@systim = external dso_local global i32, align 4
@tim = external dso_local global [100001 x i32], align 16
@vis = external dso_local global [100001 x i8], align 16
@a = external dso_local global [200002 x %"struct.std::pair.0"], align 16
@_ZL4maxn = external hidden constant i32, align 4

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

33:                                               ; preds = %48, %5
  %34 = load i32, ptr %12, align 4, !tbaa !5
  %35 = load i32, ptr %6, align 4, !tbaa !5
  %36 = icmp slt i32 %34, %35
  br i1 %36, label %38, label %37

37:                                               ; preds = %33
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #5
  br label %51

38:                                               ; preds = %33
  %39 = load ptr, ptr %7, align 8, !tbaa !9
  %40 = load i32, ptr %12, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds i32, ptr %39, i64 %41
  %43 = load i32, ptr %42, align 4, !tbaa !5
  %44 = load i32, ptr %11, align 4, !tbaa !5
  %45 = add nsw i32 %44, 1
  store i32 %45, ptr %11, align 4, !tbaa !5
  %46 = sext i32 %44 to i64
  %47 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %46
  store i32 %43, ptr %47, align 4, !tbaa !5
  br label %48

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

51:                                               ; preds = %37
  %52 = load i32, ptr %11, align 4, !tbaa !5
  %53 = sext i32 %52 to i64
  %54 = getelementptr inbounds i32, ptr @que, i64 %53
  call void @_ZSt4sortIPiEvT_S1_(ptr noundef @que, ptr noundef %54)
  %55 = load i32, ptr %11, align 4, !tbaa !5
  %56 = sext i32 %55 to i64
  %57 = getelementptr inbounds i32, ptr @que, i64 %56
  %58 = call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef @que, ptr noundef %57)
  %59 = ptrtoint ptr %58 to i64
  %60 = sub i64 %59, ptrtoint (ptr @que to i64)
  %61 = sdiv exact i64 %60, 4
  %62 = trunc i64 %61 to i32
  store i32 %62, ptr %11, align 4, !tbaa !5
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #5
  store i32 0, ptr %13, align 4, !tbaa !5
  br label %63

63:                                               ; preds = %90, %51
  %64 = load i32, ptr %13, align 4, !tbaa !5
  %65 = load i32, ptr %6, align 4, !tbaa !5
  %66 = icmp slt i32 %64, %65
  br i1 %66, label %68, label %67

67:                                               ; preds = %63
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #5
  br label %93

68:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 24, ptr %14) #5
  %69 = load ptr, ptr %8, align 8, !tbaa !9
  %70 = load i32, ptr %13, align 4, !tbaa !5
  %71 = sext i32 %70 to i64
  %72 = getelementptr inbounds i32, ptr %69, i64 %71
  call void @llvm.lifetime.start.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.start.p0(i64 8, ptr %16) #5
  %73 = load i32, ptr %11, align 4, !tbaa !5
  %74 = sext i32 %73 to i64
  %75 = getelementptr inbounds i32, ptr @que, i64 %74
  %76 = load ptr, ptr %7, align 8, !tbaa !9
  %77 = load i32, ptr %13, align 4, !tbaa !5
  %78 = sext i32 %77 to i64
  %79 = getelementptr inbounds i32, ptr %76, i64 %78
  %80 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef @que, ptr noundef %75, ptr noundef nonnull align 4 dereferenceable(4) %79)
  %81 = ptrtoint ptr %80 to i64
  %82 = sub i64 %81, ptrtoint (ptr @que to i64)
  %83 = sdiv exact i64 %82, 4
  store i64 %83, ptr %16, align 8, !tbaa !13
  %84 = call { i64, i32 } @_ZSt9make_pairIlRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %16, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store { i64, i32 } %84, ptr %17, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %15, ptr align 8 %17, i64 12, i1 false)
  call void @_ZSt9make_pairIRiSt4pairIliEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind writable sret(%"struct.std::pair.2") align 8 %14, ptr noundef nonnull align 4 dereferenceable(4) %72, ptr noundef nonnull align 8 dereferenceable(12) %15)
  %85 = load i32, ptr @tot, align 4, !tbaa !5
  %86 = add nsw i32 %85, 1
  store i32 %86, ptr @tot, align 4, !tbaa !5
  %87 = sext i32 %85 to i64
  %88 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %87
  %89 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt4pairIiS_IiiEEaSIiS_IliEEENSt9enable_ifIXsr6__and_ISt13is_assignableIRiOT_ES5_IRS0_OT0_EEE5valueERS1_E4typeEOS_IS7_SB_E(ptr noundef nonnull align 4 dereferenceable(12) %88, ptr noundef nonnull align 8 dereferenceable(24) %14)
  call void @llvm.lifetime.end.p0(i64 8, ptr %16) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr %15) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr %14) #5
  br label %90

90:                                               ; preds = %68
  %91 = load i32, ptr %13, align 4, !tbaa !5
  %92 = add nsw i32 %91, 1
  store i32 %92, ptr %13, align 4, !tbaa !5
  br label %63, !llvm.loop !15

93:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #5
  store i32 0, ptr %18, align 4, !tbaa !5
  br label %94

94:                                               ; preds = %111, %93
  %95 = load i32, ptr %18, align 4, !tbaa !5
  %96 = load i32, ptr %9, align 4, !tbaa !5
  %97 = icmp slt i32 %95, %96
  br i1 %97, label %99, label %98

98:                                               ; preds = %94
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #5
  br label %114

99:                                               ; preds = %94
  call void @llvm.lifetime.start.p0(i64 12, ptr %19) #5
  %100 = load ptr, ptr %10, align 8, !tbaa !9
  %101 = load i32, ptr %18, align 4, !tbaa !5
  %102 = sext i32 %101 to i64
  %103 = getelementptr inbounds i32, ptr %100, i64 %102
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #5
  store i32 -1, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #5
  store i32 -1, ptr %22, align 4, !tbaa !5
  %104 = 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 %104, ptr %20, align 4
  %105 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %103, ptr noundef nonnull align 4 dereferenceable(8) %20)
  store { i64, i32 } %105, ptr %23, align 8
  call void @llvm.memcpy.p0.p0.i64(ptr align 4 %19, ptr align 8 %23, i64 12, i1 false)
  %106 = load i32, ptr @tot, align 4, !tbaa !5
  %107 = add nsw i32 %106, 1
  store i32 %107, ptr @tot, align 4, !tbaa !5
  %108 = sext i32 %106 to i64
  %109 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %108
  %110 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt4pairIiS_IiiEEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(12) %109, ptr noundef nonnull align 4 dereferenceable(12) %19) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #5
  call void @llvm.lifetime.end.p0(i64 12, ptr %19) #5
  br label %111

111:                                              ; preds = %99
  %112 = load i32, ptr %18, align 4, !tbaa !5
  %113 = add nsw i32 %112, 1
  store i32 %113, ptr %18, align 4, !tbaa !5
  br label %94, !llvm.loop !16

114:                                              ; preds = %98
  %115 = load i32, ptr @tot, align 4, !tbaa !5
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds %"struct.std::pair.0", ptr @a, i64 %116
  call void @_ZSt4sortIPSt4pairIiS0_IiiEEEvT_S4_(ptr noundef @a, ptr noundef %117)
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #5
  store i32 0, ptr %24, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #5
  store i32 0, ptr %25, align 4, !tbaa !5
  br label %118

118:                                              ; preds = %171, %114
  %119 = load i32, ptr %24, align 4, !tbaa !5
  %120 = load i32, ptr @tot, align 4, !tbaa !5
  %121 = icmp slt i32 %119, %120
  br i1 %121, label %123, label %122

122:                                              ; preds = %118
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #5
  br label %174

123:                                              ; preds = %118
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #5
  %124 = load i32, ptr %24, align 4, !tbaa !5
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %125
  %127 = getelementptr inbounds %"struct.std::pair.0", ptr %126, i32 0, i32 0
  %128 = load i32, ptr %127, align 4, !tbaa !17
  store i32 %128, ptr %26, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %27) #5
  %129 = load i32, ptr %24, align 4, !tbaa !5
  %130 = sext i32 %129 to i64
  %131 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %130
  %132 = getelementptr inbounds %"struct.std::pair.0", ptr %131, i32 0, i32 1
  %133 = getelementptr inbounds %"struct.std::pair", ptr %132, i32 0, i32 0
  %134 = load i32, ptr %133, align 4, !tbaa !20
  store i32 %134, ptr %27, align 4, !tbaa !5
  %135 = load i32, ptr %27, align 4, !tbaa !5
  %136 = icmp slt i32 %135, 0
  br i1 %136, label %137, label %146

137:                                              ; preds = %123
  store i32 1, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #5
  %138 = call i64 @_ZSt9make_pairIRKiS1_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) @_ZL4maxn, ptr noundef nonnull align 4 dereferenceable(4) @_ZL4maxn)
  store i64 %138, ptr %28, align 4
  %139 = load i32, ptr %24, align 4, !tbaa !5
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %140
  %142 = getelementptr inbounds %"struct.std::pair.0", ptr %141, i32 0, i32 1
  %143 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %142, ptr noundef nonnull align 4 dereferenceable(8) %28) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #5
  %144 = load i32, ptr @systim, align 4, !tbaa !5
  %145 = add nsw i32 %144, 1
  store i32 %145, ptr @systim, align 4, !tbaa !5
  br label %170

146:                                              ; preds = %123
  %147 = load i32, ptr %25, align 4, !tbaa !5
  %148 = icmp ne i32 %147, 0
  br i1 %148, label %149, label %169

149:                                              ; preds = %146
  %150 = load i32, ptr %27, align 4, !tbaa !5
  %151 = sext i32 %150 to i64
  %152 = getelementptr inbounds [100001 x i32], ptr @tim, i64 0, i64 %151
  %153 = load i32, ptr %152, align 4, !tbaa !5
  %154 = load i32, ptr @systim, align 4, !tbaa !5
  %155 = icmp ne i32 %153, %154
  br i1 %155, label %156, label %169

156:                                              ; preds = %149
  %157 = load i32, ptr %24, align 4, !tbaa !5
  %158 = sext i32 %157 to i64
  %159 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %158
  %160 = getelementptr inbounds %"struct.std::pair.0", ptr %159, i32 0, i32 1
  %161 = getelementptr inbounds %"struct.std::pair", ptr %160, i32 0, i32 1
  %162 = load i32, ptr %161, align 4, !tbaa !21
  %163 = sext i32 %162 to i64
  %164 = getelementptr inbounds [100001 x i8], ptr @vis, i64 0, i64 %163
  store i8 1, ptr %164, align 1, !tbaa !22
  %165 = load i32, ptr @systim, align 4, !tbaa !5
  %166 = load i32, ptr %27, align 4, !tbaa !5
  %167 = sext i32 %166 to i64
  %168 = getelementptr inbounds [100001 x i32], ptr @tim, i64 0, i64 %167
  store i32 %165, ptr %168, align 4, !tbaa !5
  br label %169

169:                                              ; preds = %156, %149, %146
  br label %170

170:                                              ; preds = %169, %137
  call void @llvm.lifetime.end.p0(i64 4, ptr %27) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #5
  br label %171

171:                                              ; preds = %170
  %172 = load i32, ptr %24, align 4, !tbaa !5
  %173 = add nsw i32 %172, 1
  store i32 %173, ptr %24, align 4, !tbaa !5
  br label %118, !llvm.loop !24

174:                                              ; preds = %122
  %175 = load i32, ptr @tot, align 4, !tbaa !5
  %176 = sext i32 %175 to i64
  %177 = getelementptr inbounds %"struct.std::pair.0", ptr @a, i64 %176
  call void @_ZSt4sortIPSt4pairIiS0_IiiEEEvT_S4_(ptr noundef @a, ptr noundef %177)
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #5
  %178 = load i32, ptr @tot, align 4, !tbaa !5
  %179 = sub nsw i32 %178, 1
  store i32 %179, ptr %29, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %30) #5
  store i32 0, ptr %30, align 4, !tbaa !5
  br label %180

180:                                              ; preds = %226, %174
  %181 = load i32, ptr %29, align 4, !tbaa !5
  %182 = icmp sge i32 %181, 0
  br i1 %182, label %184, label %183

183:                                              ; preds = %180
  call void @llvm.lifetime.end.p0(i64 4, ptr %30) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #5
  br label %229

184:                                              ; preds = %180
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #5
  %185 = load i32, ptr %29, align 4, !tbaa !5
  %186 = sext i32 %185 to i64
  %187 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %186
  %188 = getelementptr inbounds %"struct.std::pair.0", ptr %187, i32 0, i32 0
  %189 = load i32, ptr %188, align 4, !tbaa !17
  store i32 %189, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #5
  %190 = load i32, ptr %29, align 4, !tbaa !5
  %191 = sext i32 %190 to i64
  %192 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %191
  %193 = getelementptr inbounds %"struct.std::pair.0", ptr %192, i32 0, i32 1
  %194 = getelementptr inbounds %"struct.std::pair", ptr %193, i32 0, i32 0
  %195 = load i32, ptr %194, align 4, !tbaa !20
  store i32 %195, ptr %32, align 4, !tbaa !5
  %196 = load i32, ptr %32, align 4, !tbaa !5
  %197 = icmp slt i32 %196, 0
  br i1 %197, label %198, label %201

198:                                              ; preds = %184
  store i32 1, ptr %30, align 4, !tbaa !5
  %199 = load i32, ptr @systim, align 4, !tbaa !5
  %200 = add nsw i32 %199, 1
  store i32 %200, ptr @systim, align 4, !tbaa !5
  br label %225

201:                                              ; preds = %184
  %202 = load i32, ptr %30, align 4, !tbaa !5
  %203 = icmp ne i32 %202, 0
  br i1 %203, label %204, label %224

204:                                              ; preds = %201
  %205 = load i32, ptr %32, align 4, !tbaa !5
  %206 = sext i32 %205 to i64
  %207 = getelementptr inbounds [100001 x i32], ptr @tim, i64 0, i64 %206
  %208 = load i32, ptr %207, align 4, !tbaa !5
  %209 = load i32, ptr @systim, align 4, !tbaa !5
  %210 = icmp ne i32 %208, %209
  br i1 %210, label %211, label %224

211:                                              ; preds = %204
  %212 = load i32, ptr %29, align 4, !tbaa !5
  %213 = sext i32 %212 to i64
  %214 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %213
  %215 = getelementptr inbounds %"struct.std::pair.0", ptr %214, i32 0, i32 1
  %216 = getelementptr inbounds %"struct.std::pair", ptr %215, i32 0, i32 1
  %217 = load i32, ptr %216, align 4, !tbaa !21
  %218 = sext i32 %217 to i64
  %219 = getelementptr inbounds [100001 x i8], ptr @vis, i64 0, i64 %218
  store i8 1, ptr %219, align 1, !tbaa !22
  %220 = load i32, ptr @systim, align 4, !tbaa !5
  %221 = load i32, ptr %32, align 4, !tbaa !5
  %222 = sext i32 %221 to i64
  %223 = getelementptr inbounds [100001 x i32], ptr @tim, i64 0, i64 %222
  store i32 %220, ptr %223, align 4, !tbaa !5
  br label %224

224:                                              ; preds = %211, %204, %201
  br label %225

225:                                              ; preds = %224, %198
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #5
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #5
  br label %226

226:                                              ; preds = %225
  %227 = load i32, ptr %29, align 4, !tbaa !5
  %228 = add nsw i32 %227, -1
  store i32 %228, ptr %29, align 4, !tbaa !5
  br label %180, !llvm.loop !25

229:                                              ; preds = %183
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #5
  ret void
}

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRiSt4pairIliEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.2") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(12)) #0

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

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

; Function Attrs: nocallback nofree nounwind willreturn memory(argmem: readwrite)
declare void @llvm.memcpy.p0.p0.i64(ptr noalias nocapture writeonly, ptr noalias nocapture readonly, i64, i1 immarg) #3

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

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

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

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

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

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

; 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)) #4 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 = { 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 #3 = { nocallback nofree nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { 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, !10, i64 0}
!10 = !{!"any pointer", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!14, !14, i64 0}
!14 = !{!"long", !7, i64 0}
!15 = distinct !{!15, !12}
!16 = distinct !{!16, !12}
!17 = !{!18, !6, i64 0}
!18 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !19, i64 4}
!19 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!20 = !{!18, !6, i64 4}
!21 = !{!18, !6, i64 8}
!22 = !{!23, !23, i64 0}
!23 = !{!"bool", !7, i64 0}
!24 = distinct !{!24, !12}
!25 = distinct !{!25, !12}


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

@tot = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local global [100001 x i32], align 16
@systim = external dso_local local_unnamed_addr global i32, align 4
@tim = external dso_local local_unnamed_addr global [100001 x i32], align 16
@vis = external dso_local local_unnamed_addr global [100001 x i8], align 16
@a = external dso_local global [200002 x %"struct.std::pair.0"], align 16
@_ZL4maxn = external hidden constant i32, align 4

; Function Attrs: mustprogress uwtable
define dso_local void @_Z5solveiPiS_iS_(i32 noundef %0, ptr noundef %1, ptr noundef %2, i32 noundef %3, ptr noundef %4) local_unnamed_addr #0 {
  %6 = alloca i32, align 4
  %7 = alloca %"struct.std::pair.2", align 8
  %8 = alloca %"struct.std::pair.4", align 8
  %9 = alloca i64, align 8
  %10 = alloca %"struct.std::pair.0", align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca %"struct.std::pair", align 8
  %15 = icmp sgt i32 %0, 0
  br i1 %15, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %5
  %16 = ptrtoint ptr %1 to i64
  %wide.trip.count = zext nneg i32 %0 to i64
  %min.iters.check = icmp ult i32 %0, 8
  %17 = sub i64 ptrtoint (ptr @que to i64), %16
  %diff.check = icmp ult i64 %17, 32
  %or.cond = or i1 %min.iters.check, %diff.check
  br i1 %or.cond, label %.lr.ph.preheader93, label %vector.ph

.lr.ph.preheader93:                               ; preds = %middle.block, %.lr.ph.preheader
  %indvars.iv.ph = phi i64 [ 0, %.lr.ph.preheader ], [ %n.vec, %middle.block ]
  %xtraiter = and i64 %wide.trip.count, 3
  %lcmp.mod.not = icmp eq i64 %xtraiter, 0
  br i1 %lcmp.mod.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol

.lr.ph.prol:                                      ; preds = %.lr.ph.preheader93, %.lr.ph.prol
  %indvars.iv.prol = phi i64 [ %indvars.iv.next.prol, %.lr.ph.prol ], [ %indvars.iv.ph, %.lr.ph.preheader93 ]
  %prol.iter = phi i64 [ %prol.iter.next, %.lr.ph.prol ], [ 0, %.lr.ph.preheader93 ]
  %18 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.prol
  %19 = load i32, ptr %18, align 4, !tbaa !5
  %indvars.iv.next.prol = add nuw nsw i64 %indvars.iv.prol, 1
  %20 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %indvars.iv.prol
  store i32 %19, ptr %20, align 4, !tbaa !5
  %prol.iter.next = add i64 %prol.iter, 1
  %prol.iter.cmp.not = icmp eq i64 %prol.iter.next, %xtraiter
  br i1 %prol.iter.cmp.not, label %.lr.ph.prol.loopexit, label %.lr.ph.prol, !llvm.loop !9

.lr.ph.prol.loopexit:                             ; preds = %.lr.ph.prol, %.lr.ph.preheader93
  %indvars.iv.unr = phi i64 [ %indvars.iv.ph, %.lr.ph.preheader93 ], [ %indvars.iv.next.prol, %.lr.ph.prol ]
  %21 = sub nsw i64 %indvars.iv.ph, %wide.trip.count
  %22 = icmp ugt i64 %21, -4
  br i1 %22, label %._crit_edge.loopexit, label %.lr.ph

vector.ph:                                        ; preds = %.lr.ph.preheader
  %n.vec = and i64 %wide.trip.count, 2147483640
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i64 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %23 = getelementptr inbounds i32, ptr %1, i64 %index
  %24 = getelementptr inbounds i8, ptr %23, i64 16
  %wide.load = load <4 x i32>, ptr %23, align 4, !tbaa !5
  %wide.load92 = load <4 x i32>, ptr %24, align 4, !tbaa !5
  %25 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %index
  %26 = getelementptr inbounds i8, ptr %25, i64 16
  store <4 x i32> %wide.load, ptr %25, align 16, !tbaa !5
  store <4 x i32> %wide.load92, ptr %26, align 16, !tbaa !5
  %index.next = add nuw i64 %index, 8
  %27 = icmp eq i64 %index.next, %n.vec
  br i1 %27, label %middle.block, label %vector.body, !llvm.loop !11

middle.block:                                     ; preds = %vector.body
  %cmp.n = icmp eq i64 %n.vec, %wide.trip.count
  br i1 %cmp.n, label %._crit_edge.loopexit, label %.lr.ph.preheader93

._crit_edge.loopexit:                             ; preds = %.lr.ph.prol.loopexit, %.lr.ph, %middle.block
  %28 = zext nneg i32 %0 to i64
  br label %._crit_edge

._crit_edge:                                      ; preds = %5, %._crit_edge.loopexit
  %.0.lcssa = phi i64 [ %28, %._crit_edge.loopexit ], [ 0, %5 ]
  %29 = getelementptr inbounds i32, ptr @que, i64 %.0.lcssa
  tail call void @_ZSt4sortIPiEvT_S1_(ptr noundef nonnull @que, ptr noundef nonnull %29)
  %30 = tail call noundef ptr @_ZSt6uniqueIPiET_S1_S1_(ptr noundef nonnull @que, ptr noundef nonnull %29)
  store i32 0, ptr @tot, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %6) #4
  store i32 0, ptr %6, align 4, !tbaa !5
  br i1 %15, label %.lr.ph57, label %._crit_edge58

.lr.ph57:                                         ; preds = %._crit_edge
  %31 = ptrtoint ptr %30 to i64
  %32 = sub i64 %31, ptrtoint (ptr @que to i64)
  %sext = shl i64 %32, 30
  %33 = ashr i64 %sext, 32
  %34 = getelementptr inbounds i32, ptr @que, i64 %33
  %.sroa.225.0..sroa_idx = getelementptr inbounds i8, ptr %8, i64 8
  br label %48

.lr.ph:                                           ; preds = %.lr.ph.prol.loopexit, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next.3, %.lr.ph ], [ %indvars.iv.unr, %.lr.ph.prol.loopexit ]
  %35 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv
  %36 = load i32, ptr %35, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %37 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %indvars.iv
  store i32 %36, ptr %37, align 4, !tbaa !5
  %38 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next
  %39 = load i32, ptr %38, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %40 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %indvars.iv.next
  store i32 %39, ptr %40, align 4, !tbaa !5
  %41 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next.1
  %42 = load i32, ptr %41, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %43 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %indvars.iv.next.1
  store i32 %42, ptr %43, align 4, !tbaa !5
  %44 = getelementptr inbounds i32, ptr %1, i64 %indvars.iv.next.2
  %45 = load i32, ptr %44, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %46 = getelementptr inbounds [100001 x i32], ptr @que, i64 0, i64 %indvars.iv.next.2
  store i32 %45, ptr %46, align 4, !tbaa !5
  %exitcond.not.3 = icmp eq i64 %indvars.iv.next.3, %wide.trip.count
  br i1 %exitcond.not.3, label %._crit_edge.loopexit, label %.lr.ph, !llvm.loop !15

._crit_edge58:                                    ; preds = %48, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %6) #4
  %47 = icmp sgt i32 %3, 0
  br i1 %47, label %.lr.ph61, label %._crit_edge62

.lr.ph61:                                         ; preds = %._crit_edge58
  %.sroa.2.0..sroa_idx = getelementptr inbounds i8, ptr %10, i64 8
  %wide.trip.count83 = zext nneg i32 %3 to i64
  br label %70

48:                                               ; preds = %.lr.ph57, %48
  %storemerge55 = phi i32 [ 0, %.lr.ph57 ], [ %63, %48 ]
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #4
  %49 = sext i32 %storemerge55 to i64
  %50 = getelementptr inbounds i32, ptr %2, i64 %49
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #4
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #4
  %51 = getelementptr inbounds i32, ptr %1, i64 %49
  %52 = call noundef ptr @_ZSt11lower_boundIPiiET_S1_S1_RKT0_(ptr noundef nonnull @que, ptr noundef nonnull %34, ptr noundef nonnull align 4 dereferenceable(4) %51)
  %53 = ptrtoint ptr %52 to i64
  %54 = sub i64 %53, ptrtoint (ptr @que to i64)
  %55 = ashr exact i64 %54, 2
  store i64 %55, ptr %9, align 8, !tbaa !16
  %56 = call { i64, i32 } @_ZSt9make_pairIlRiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %.fca.0.extract22 = extractvalue { i64, i32 } %56, 0
  %.fca.1.extract23 = extractvalue { i64, i32 } %56, 1
  store i64 %.fca.0.extract22, ptr %8, align 8
  store i32 %.fca.1.extract23, ptr %.sroa.225.0..sroa_idx, align 8
  call void @_ZSt9make_pairIRiSt4pairIliEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind nonnull writable sret(%"struct.std::pair.2") align 8 %7, ptr noundef nonnull align 4 dereferenceable(4) %50, ptr noundef nonnull align 8 dereferenceable(12) %8)
  %57 = load i32, ptr @tot, align 4, !tbaa !5
  %58 = add nsw i32 %57, 1
  store i32 %58, ptr @tot, align 4, !tbaa !5
  %59 = sext i32 %57 to i64
  %60 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %59
  %61 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt4pairIiS_IiiEEaSIiS_IliEEENSt9enable_ifIXsr6__and_ISt13is_assignableIRiOT_ES5_IRS0_OT0_EEE5valueERS1_E4typeEOS_IS7_SB_E(ptr noundef nonnull align 4 dereferenceable(12) %60, ptr noundef nonnull align 8 dereferenceable(24) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #4
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #4
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #4
  %62 = load i32, ptr %6, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr %6, align 4, !tbaa !5
  %64 = icmp slt i32 %63, %0
  br i1 %64, label %48, label %._crit_edge58, !llvm.loop !18

._crit_edge62:                                    ; preds = %70, %._crit_edge58
  %65 = load i32, ptr @tot, align 4, !tbaa !5
  %66 = sext i32 %65 to i64
  %67 = getelementptr inbounds %"struct.std::pair.0", ptr @a, i64 %66
  call void @_ZSt4sortIPSt4pairIiS0_IiiEEEvT_S4_(ptr noundef nonnull @a, ptr noundef nonnull %67)
  %68 = load i32, ptr @tot, align 4, !tbaa !5
  %69 = icmp sgt i32 %68, 0
  br i1 %69, label %.lr.ph66, label %._crit_edge62.._crit_edge67_crit_edge

._crit_edge62.._crit_edge67_crit_edge:            ; preds = %._crit_edge62
  %.pre91 = sext i32 %68 to i64
  br label %._crit_edge67

70:                                               ; preds = %.lr.ph61, %70
  %indvars.iv80 = phi i64 [ 0, %.lr.ph61 ], [ %indvars.iv.next81, %70 ]
  call void @llvm.lifetime.start.p0(i64 12, ptr nonnull %10) #4
  %71 = getelementptr inbounds i32, ptr %4, i64 %indvars.iv80
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %12) #4
  store i32 -1, ptr %12, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #4
  store i32 -1, ptr %13, align 4, !tbaa !5
  %72 = call i64 @_ZSt9make_pairIiiESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS1_INS2_IT0_E4typeEE6__typeEEOS3_OS8_(ptr noundef nonnull align 4 dereferenceable(4) %12, ptr noundef nonnull align 4 dereferenceable(4) %13)
  store i64 %72, ptr %11, align 8
  %73 = call { i64, i32 } @_ZSt9make_pairIRiSt4pairIiiEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) %71, ptr noundef nonnull align 4 dereferenceable(8) %11)
  %.fca.0.extract = extractvalue { i64, i32 } %73, 0
  %.fca.1.extract = extractvalue { i64, i32 } %73, 1
  store i64 %.fca.0.extract, ptr %10, align 8
  store i32 %.fca.1.extract, ptr %.sroa.2.0..sroa_idx, align 8
  %74 = load i32, ptr @tot, align 4, !tbaa !5
  %75 = add nsw i32 %74, 1
  store i32 %75, ptr @tot, align 4, !tbaa !5
  %76 = sext i32 %74 to i64
  %77 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %76
  %78 = call noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt4pairIiS_IiiEEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(12) %77, ptr noundef nonnull align 4 dereferenceable(12) %10) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #4
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %12) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #4
  call void @llvm.lifetime.end.p0(i64 12, ptr nonnull %10) #4
  %indvars.iv.next81 = add nuw nsw i64 %indvars.iv80, 1
  %exitcond84.not = icmp eq i64 %indvars.iv.next81, %wide.trip.count83
  br i1 %exitcond84.not, label %._crit_edge62, label %70, !llvm.loop !19

._crit_edge67:                                    ; preds = %103, %._crit_edge62.._crit_edge67_crit_edge
  %.pre-phi = phi i64 [ %.pre91, %._crit_edge62.._crit_edge67_crit_edge ], [ %105, %103 ]
  %79 = getelementptr inbounds %"struct.std::pair.0", ptr @a, i64 %.pre-phi
  call void @_ZSt4sortIPSt4pairIiS0_IiiEEEvT_S4_(ptr noundef nonnull @a, ptr noundef nonnull %79)
  %80 = load i32, ptr @tot, align 4, !tbaa !5
  %81 = icmp sgt i32 %80, 0
  br i1 %81, label %.lr.ph73.preheader, label %._crit_edge74

.lr.ph73.preheader:                               ; preds = %._crit_edge67
  %systim.promoted = load i32, ptr @systim, align 4, !tbaa !5
  %82 = zext nneg i32 %80 to i64
  br label %.lr.ph73

.lr.ph66:                                         ; preds = %._crit_edge62, %103
  %83 = phi i32 [ %104, %103 ], [ %68, %._crit_edge62 ]
  %indvars.iv85 = phi i64 [ %indvars.iv.next86, %103 ], [ 0, %._crit_edge62 ]
  %.04463 = phi i32 [ %.145, %103 ], [ 0, %._crit_edge62 ]
  %84 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %indvars.iv85, i32 1
  %85 = load i32, ptr %84, align 4, !tbaa !20
  %86 = icmp slt i32 %85, 0
  br i1 %86, label %87, label %92

87:                                               ; preds = %.lr.ph66
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %14) #4
  %88 = call i64 @_ZSt9make_pairIRKiS1_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr noundef nonnull align 4 dereferenceable(4) @_ZL4maxn, ptr noundef nonnull align 4 dereferenceable(4) @_ZL4maxn)
  store i64 %88, ptr %14, align 8
  %89 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt4pairIiiEaSEOS0_(ptr noundef nonnull align 4 dereferenceable(8) %84, ptr noundef nonnull align 4 dereferenceable(8) %14) #4
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %14) #4
  %90 = load i32, ptr @systim, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr @systim, align 4, !tbaa !5
  %.pre = load i32, ptr @tot, align 4, !tbaa !5
  br label %103

92:                                               ; preds = %.lr.ph66
  %.not51 = icmp eq i32 %.04463, 0
  br i1 %.not51, label %103, label %93

93:                                               ; preds = %92
  %94 = zext nneg i32 %85 to i64
  %95 = getelementptr inbounds [100001 x i32], ptr @tim, i64 0, i64 %94
  %96 = load i32, ptr %95, align 4, !tbaa !5
  %97 = load i32, ptr @systim, align 4, !tbaa !5
  %.not52 = icmp eq i32 %96, %97
  br i1 %.not52, label %103, label %98

98:                                               ; preds = %93
  %99 = getelementptr inbounds i8, ptr %84, i64 4
  %100 = load i32, ptr %99, align 4, !tbaa !23
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100001 x i8], ptr @vis, i64 0, i64 %101
  store i8 1, ptr %102, align 1, !tbaa !24
  store i32 %97, ptr %95, align 4, !tbaa !5
  br label %103

103:                                              ; preds = %92, %93, %98, %87
  %104 = phi i32 [ %.pre, %87 ], [ %83, %98 ], [ %83, %93 ], [ %83, %92 ]
  %.145 = phi i32 [ 1, %87 ], [ 1, %98 ], [ 1, %93 ], [ 0, %92 ]
  %indvars.iv.next86 = add nuw nsw i64 %indvars.iv85, 1
  %105 = sext i32 %104 to i64
  %106 = icmp slt i64 %indvars.iv.next86, %105
  br i1 %106, label %.lr.ph66, label %._crit_edge67, !llvm.loop !26

._crit_edge74:                                    ; preds = %123, %._crit_edge67
  ret void

.lr.ph73:                                         ; preds = %.lr.ph73.preheader, %123
  %indvars.iv88 = phi i64 [ %82, %.lr.ph73.preheader ], [ %indvars.iv.next89, %123 ]
  %.04070 = phi i32 [ 0, %.lr.ph73.preheader ], [ %.1, %123 ]
  %107 = phi i32 [ %systim.promoted, %.lr.ph73.preheader ], [ %124, %123 ]
  %indvars.iv.next89 = add nsw i64 %indvars.iv88, -1
  %108 = getelementptr inbounds [200002 x %"struct.std::pair.0"], ptr @a, i64 0, i64 %indvars.iv.next89, i32 1
  %109 = load i32, ptr %108, align 4, !tbaa !20
  %110 = icmp slt i32 %109, 0
  br i1 %110, label %111, label %113

111:                                              ; preds = %.lr.ph73
  %112 = add nsw i32 %107, 1
  store i32 %112, ptr @systim, align 4, !tbaa !5
  br label %123

113:                                              ; preds = %.lr.ph73
  %.not = icmp eq i32 %.04070, 0
  br i1 %.not, label %123, label %114

114:                                              ; preds = %113
  %115 = zext nneg i32 %109 to i64
  %116 = getelementptr inbounds [100001 x i32], ptr @tim, i64 0, i64 %115
  %117 = load i32, ptr %116, align 4, !tbaa !5
  %.not50 = icmp eq i32 %117, %107
  br i1 %.not50, label %123, label %118

118:                                              ; preds = %114
  %119 = getelementptr inbounds i8, ptr %108, i64 4
  %120 = load i32, ptr %119, align 4, !tbaa !23
  %121 = sext i32 %120 to i64
  %122 = getelementptr inbounds [100001 x i8], ptr @vis, i64 0, i64 %121
  store i8 1, ptr %122, align 1, !tbaa !24
  store i32 %107, ptr %116, align 4, !tbaa !5
  br label %123

123:                                              ; preds = %113, %114, %118, %111
  %124 = phi i32 [ %112, %111 ], [ %107, %118 ], [ %107, %114 ], [ %107, %113 ]
  %.1 = phi i32 [ 1, %111 ], [ 1, %118 ], [ 1, %114 ], [ 0, %113 ]
  %125 = icmp ugt i64 %indvars.iv88, 1
  br i1 %125, label %.lr.ph73, label %._crit_edge74, !llvm.loop !27
}

; 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: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIPiEvT_S1_(ptr noundef, ptr noundef) local_unnamed_addr #2

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZSt9make_pairIRiSt4pairIliEES1_INSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS3_INS4_IT0_E4typeEE6__typeEEOS5_OSA_(ptr dead_on_unwind noalias writable sret(%"struct.std::pair.2") align 8, ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(12)) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(12) ptr @_ZNSt4pairIiS_IiiEEaSEOS1_(ptr noundef nonnull align 4 dereferenceable(12), ptr noundef nonnull align 4 dereferenceable(12)) local_unnamed_addr #3 align 2

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

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

; 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 #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 = { 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 #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 = { 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.unroll.disable"}
!11 = distinct !{!11, !12, !13, !14}
!12 = !{!"llvm.loop.mustprogress"}
!13 = !{!"llvm.loop.isvectorized", i32 1}
!14 = !{!"llvm.loop.unroll.runtime.disable"}
!15 = distinct !{!15, !12, !13}
!16 = !{!17, !17, i64 0}
!17 = !{!"long", !7, i64 0}
!18 = distinct !{!18, !12}
!19 = distinct !{!19, !12}
!20 = !{!21, !6, i64 4}
!21 = !{!"_ZTSSt4pairIiS_IiiEE", !6, i64 0, !22, i64 4}
!22 = !{!"_ZTSSt4pairIiiE", !6, i64 0, !6, i64 4}
!23 = !{!21, !6, i64 8}
!24 = !{!25, !25, i64 0}
!25 = !{!"bool", !7, i64 0}
!26 = distinct !{!26, !12}
!27 = distinct !{!27, !12}


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