; LLVM IR from tangjz/acm-icpc :: codeforces/complete (662B)

; 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"

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@L = external dso_local global i32, align 4
@R = external dso_local global i32, align 4
@que = external dso_local global [100010 x i32], align 16
@col = external dso_local global [100010 x i32], align 16
@ans = external dso_local global [2 x i32], align 4
@out = external dso_local global [2 x [100010 x i32]], align 16
@e = external dso_local global [100010 x %"class.std::vector"], align 16
@vis = external dso_local global [100010 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca [2 x i8], align 1
  %6 = alloca %"struct.std::pair", align 4
  %7 = alloca %"struct.std::pair", align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %13 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %14 = alloca i32, align 4
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  %17 = alloca i32, align 4
  %18 = alloca i32, align 4
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca i32, align 4
  %22 = alloca i32, align 4
  %23 = alloca i32, align 4
  %24 = alloca i32, align 4
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %27 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef @n, ptr noundef @m)
  br label %28

28:                                               ; preds = %32, %0
  %29 = load i32, ptr @m, align 4, !tbaa !5
  %30 = add nsw i32 %29, -1
  store i32 %30, ptr @m, align 4, !tbaa !5
  %31 = icmp ne i32 %29, 0
  br i1 %31, label %32, label %48

32:                                               ; preds = %28
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.start.p0(i64 2, ptr %5) #7
  %33 = getelementptr inbounds [2 x i8], ptr %5, i64 0, i64 0
  %34 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %2, ptr noundef %3, ptr noundef %33)
  %35 = getelementptr inbounds [2 x i8], ptr %5, i64 0, i64 0
  %36 = load i8, ptr %35, align 1, !tbaa !9
  %37 = sext i8 %36 to i32
  %38 = icmp eq i32 %37, 66
  %39 = zext i1 %38 to i32
  store i32 %39, ptr %4, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = sext i32 %40 to i64
  %42 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %41
  call void @llvm.lifetime.start.p0(i64 8, ptr %6) #7
  %43 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %3, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %43, ptr %6, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %42, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr %6) #7
  %44 = load i32, ptr %3, align 4, !tbaa !5
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %45
  call void @llvm.lifetime.start.p0(i64 8, ptr %7) #7
  %47 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %4)
  store i64 %47, ptr %7, align 4
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %46, ptr noundef nonnull align 4 dereferenceable(8) %7)
  call void @llvm.lifetime.end.p0(i64 8, ptr %7) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr %5) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #7
  br label %28, !llvm.loop !10

48:                                               ; preds = %28
  store i32 0, ptr getelementptr inbounds ([2 x i32], ptr @ans, i64 0, i64 1), align 4, !tbaa !5
  store i32 0, ptr @ans, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #7
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %49

49:                                               ; preds = %306, %48
  %50 = load i32, ptr %8, align 4, !tbaa !5
  %51 = icmp slt i32 %50, 2
  br i1 %51, label %53, label %52

52:                                               ; preds = %49
  store i32 4, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #7
  br label %309

53:                                               ; preds = %49
  call void @llvm.memset.p0.i64(ptr align 16 @vis, i8 0, i64 100010, i1 false)
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #7
  store i32 1, ptr %10, align 4, !tbaa !5
  br label %54

54:                                               ; preds = %301, %53
  %55 = load i32, ptr %10, align 4, !tbaa !5
  %56 = load i32, ptr @n, align 4, !tbaa !5
  %57 = icmp sle i32 %55, %56
  br i1 %57, label %59, label %58

58:                                               ; preds = %54
  store i32 7, ptr %9, align 4
  br label %304

59:                                               ; preds = %54
  %60 = load i32, ptr %10, align 4, !tbaa !5
  %61 = sext i32 %60 to i64
  %62 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %61
  %63 = load i8, ptr %62, align 1, !tbaa !12, !range !14, !noundef !15
  %64 = trunc i8 %63 to i1
  br i1 %64, label %300, label %65

65:                                               ; preds = %59
  store i32 0, ptr @R, align 4, !tbaa !5
  store i32 0, ptr @L, align 4, !tbaa !5
  %66 = load i32, ptr %10, align 4, !tbaa !5
  %67 = load i32, ptr @R, align 4, !tbaa !5
  %68 = add nsw i32 %67, 1
  store i32 %68, ptr @R, align 4, !tbaa !5
  %69 = sext i32 %67 to i64
  %70 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %69
  store i32 %66, ptr %70, align 4, !tbaa !5
  %71 = load i32, ptr %10, align 4, !tbaa !5
  %72 = sext i32 %71 to i64
  %73 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %72
  store i8 1, ptr %73, align 1, !tbaa !12
  br label %74

74:                                               ; preds = %121, %65
  %75 = load i32, ptr @L, align 4, !tbaa !5
  %76 = load i32, ptr @R, align 4, !tbaa !5
  %77 = icmp slt i32 %75, %76
  br i1 %77, label %78, label %122

78:                                               ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #7
  %79 = load i32, ptr @L, align 4, !tbaa !5
  %80 = add nsw i32 %79, 1
  store i32 %80, ptr @L, align 4, !tbaa !5
  %81 = sext i32 %79 to i64
  %82 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %81
  %83 = load i32, ptr %82, align 4, !tbaa !5
  store i32 %83, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %12) #7
  %84 = load i32, ptr %11, align 4, !tbaa !5
  %85 = sext i32 %84 to i64
  %86 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %85
  %87 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %86) #7
  %88 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %12, i32 0, i32 0
  store ptr %87, ptr %88, align 8
  br label %89

89:                                               ; preds = %119, %78
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  %90 = load i32, ptr %11, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %91
  %93 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %92) #7
  %94 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %13, i32 0, i32 0
  store ptr %93, ptr %94, align 8
  %95 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %12, ptr noundef nonnull align 8 dereferenceable(8) %13) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br i1 %95, label %97, label %96

96:                                               ; preds = %89
  store i32 12, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %12) #7
  br label %121

97:                                               ; preds = %89
  %98 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %99 = getelementptr inbounds %"struct.std::pair", ptr %98, i32 0, i32 0
  %100 = load i32, ptr %99, align 4, !tbaa !16
  %101 = sext i32 %100 to i64
  %102 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %101
  %103 = load i8, ptr %102, align 1, !tbaa !12, !range !14, !noundef !15
  %104 = trunc i8 %103 to i1
  br i1 %104, label %118, label %105

105:                                              ; preds = %97
  %106 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %107 = getelementptr inbounds %"struct.std::pair", ptr %106, i32 0, i32 0
  %108 = load i32, ptr %107, align 4, !tbaa !16
  %109 = load i32, ptr @R, align 4, !tbaa !5
  %110 = add nsw i32 %109, 1
  store i32 %110, ptr @R, align 4, !tbaa !5
  %111 = sext i32 %109 to i64
  %112 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %111
  store i32 %108, ptr %112, align 4, !tbaa !5
  %113 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  %114 = getelementptr inbounds %"struct.std::pair", ptr %113, i32 0, i32 0
  %115 = load i32, ptr %114, align 4, !tbaa !16
  %116 = sext i32 %115 to i64
  %117 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %116
  store i8 1, ptr %117, align 1, !tbaa !12
  br label %118

118:                                              ; preds = %105, %97
  br label %119

119:                                              ; preds = %118
  %120 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %12) #7
  br label %89, !llvm.loop !18

121:                                              ; preds = %96
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #7
  br label %74, !llvm.loop !19

122:                                              ; preds = %74
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #7
  store i32 0, ptr %14, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #7
  store i32 1, ptr %15, align 4, !tbaa !5
  %123 = load i32, ptr @que, align 16, !tbaa !5
  %124 = sext i32 %123 to i64
  %125 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %124
  store i32 0, ptr %125, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %16) #7
  store i32 1, ptr %16, align 4, !tbaa !5
  br label %126

126:                                              ; preds = %138, %122
  %127 = load i32, ptr %16, align 4, !tbaa !5
  %128 = load i32, ptr @R, align 4, !tbaa !5
  %129 = icmp slt i32 %127, %128
  br i1 %129, label %131, label %130

130:                                              ; preds = %126
  store i32 15, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %16) #7
  br label %141

131:                                              ; preds = %126
  %132 = load i32, ptr %16, align 4, !tbaa !5
  %133 = sext i32 %132 to i64
  %134 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %133
  %135 = load i32, ptr %134, align 4, !tbaa !5
  %136 = sext i32 %135 to i64
  %137 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %136
  store i32 -1, ptr %137, align 4, !tbaa !5
  br label %138

138:                                              ; preds = %131
  %139 = load i32, ptr %16, align 4, !tbaa !5
  %140 = add nsw i32 %139, 1
  store i32 %140, ptr %16, align 4, !tbaa !5
  br label %126, !llvm.loop !20

141:                                              ; preds = %130
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %142

142:                                              ; preds = %223, %141
  %143 = load i32, ptr %17, align 4, !tbaa !5
  %144 = load i32, ptr @R, align 4, !tbaa !5
  %145 = icmp slt i32 %143, %144
  br i1 %145, label %147, label %146

146:                                              ; preds = %142
  store i32 18, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  br label %226

147:                                              ; preds = %142
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  %148 = load i32, ptr %17, align 4, !tbaa !5
  %149 = sext i32 %148 to i64
  %150 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %149
  %151 = load i32, ptr %150, align 4, !tbaa !5
  store i32 %151, ptr %18, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %152 = load i32, ptr %18, align 4, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %153
  %155 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %154) #7
  %156 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %155, ptr %156, align 8
  br label %157

157:                                              ; preds = %219, %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %158 = load i32, ptr %18, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %159
  %161 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %160) #7
  %162 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %161, ptr %162, align 8
  %163 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br i1 %163, label %165, label %164

164:                                              ; preds = %157
  store i32 21, ptr %9, align 4
  br label %221

165:                                              ; preds = %157
  call void @llvm.lifetime.start.p0(i64 4, ptr %21) #7
  %166 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %167 = getelementptr inbounds %"struct.std::pair", ptr %166, i32 0, i32 0
  %168 = load i32, ptr %167, align 4, !tbaa !16
  store i32 %168, ptr %21, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %22) #7
  %169 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  %170 = getelementptr inbounds %"struct.std::pair", ptr %169, i32 0, i32 1
  %171 = load i32, ptr %170, align 4, !tbaa !21
  store i32 %171, ptr %22, align 4, !tbaa !5
  %172 = load i32, ptr %21, align 4, !tbaa !5
  %173 = sext i32 %172 to i64
  %174 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %173
  %175 = load i32, ptr %174, align 4, !tbaa !5
  %176 = icmp eq i32 %175, -1
  br i1 %176, label %177, label %198

177:                                              ; preds = %165
  %178 = load i32, ptr %18, align 4, !tbaa !5
  %179 = sext i32 %178 to i64
  %180 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %179
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = load i32, ptr %22, align 4, !tbaa !5
  %183 = xor i32 %181, %182
  %184 = load i32, ptr %8, align 4, !tbaa !5
  %185 = xor i32 %183, %184
  %186 = load i32, ptr %21, align 4, !tbaa !5
  %187 = sext i32 %186 to i64
  %188 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %187
  store i32 %185, ptr %188, align 4, !tbaa !5
  %189 = load i32, ptr %21, align 4, !tbaa !5
  %190 = sext i32 %189 to i64
  %191 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %190
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = icmp ne i32 %192, 0
  br i1 %193, label %194, label %197

194:                                              ; preds = %177
  %195 = load i32, ptr %14, align 4, !tbaa !5
  %196 = add nsw i32 %195, 1
  store i32 %196, ptr %14, align 4, !tbaa !5
  br label %197

197:                                              ; preds = %194, %177
  br label %215

198:                                              ; preds = %165
  %199 = load i32, ptr %18, align 4, !tbaa !5
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %200
  %202 = load i32, ptr %201, align 4, !tbaa !5
  %203 = load i32, ptr %21, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %204
  %206 = load i32, ptr %205, align 4, !tbaa !5
  %207 = xor i32 %202, %206
  %208 = load i32, ptr %22, align 4, !tbaa !5
  %209 = xor i32 %207, %208
  %210 = load i32, ptr %8, align 4, !tbaa !5
  %211 = xor i32 %209, %210
  %212 = icmp ne i32 %211, 0
  br i1 %212, label %213, label %214

213:                                              ; preds = %198
  store i32 0, ptr %15, align 4, !tbaa !5
  store i32 21, ptr %9, align 4
  br label %216

214:                                              ; preds = %198
  br label %215

215:                                              ; preds = %214, %197
  store i32 0, ptr %9, align 4
  br label %216

216:                                              ; preds = %215, %213
  call void @llvm.lifetime.end.p0(i64 4, ptr %22) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %21) #7
  %217 = load i32, ptr %9, align 4
  switch i32 %217, label %221 [
    i32 0, label %218
  ]

218:                                              ; preds = %216
  br label %219

219:                                              ; preds = %218
  %220 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br label %157, !llvm.loop !22

221:                                              ; preds = %216, %164
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  br label %222

222:                                              ; preds = %221
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %223

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

226:                                              ; preds = %146
  %227 = load i32, ptr %15, align 4, !tbaa !5
  %228 = icmp ne i32 %227, 0
  br i1 %228, label %229, label %292

229:                                              ; preds = %226
  %230 = load i32, ptr %14, align 4, !tbaa !5
  %231 = load i32, ptr @R, align 4, !tbaa !5
  %232 = load i32, ptr %14, align 4, !tbaa !5
  %233 = sub nsw i32 %231, %232
  %234 = icmp sgt i32 %230, %233
  br i1 %234, label %235, label %257

235:                                              ; preds = %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %23) #7
  store i32 0, ptr %23, align 4, !tbaa !5
  br label %236

236:                                              ; preds = %250, %235
  %237 = load i32, ptr %23, align 4, !tbaa !5
  %238 = load i32, ptr @R, align 4, !tbaa !5
  %239 = icmp slt i32 %237, %238
  br i1 %239, label %241, label %240

240:                                              ; preds = %236
  store i32 24, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %23) #7
  br label %253

241:                                              ; preds = %236
  %242 = load i32, ptr %23, align 4, !tbaa !5
  %243 = sext i32 %242 to i64
  %244 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %243
  %245 = load i32, ptr %244, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %246
  %248 = load i32, ptr %247, align 4, !tbaa !5
  %249 = xor i32 %248, 1
  store i32 %249, ptr %247, align 4, !tbaa !5
  br label %250

250:                                              ; preds = %241
  %251 = load i32, ptr %23, align 4, !tbaa !5
  %252 = add nsw i32 %251, 1
  store i32 %252, ptr %23, align 4, !tbaa !5
  br label %236, !llvm.loop !24

253:                                              ; preds = %240
  %254 = load i32, ptr @R, align 4, !tbaa !5
  %255 = load i32, ptr %14, align 4, !tbaa !5
  %256 = sub nsw i32 %254, %255
  store i32 %256, ptr %14, align 4, !tbaa !5
  br label %257

257:                                              ; preds = %253, %229
  call void @llvm.lifetime.start.p0(i64 4, ptr %24) #7
  store i32 0, ptr %24, align 4, !tbaa !5
  br label %258

258:                                              ; preds = %288, %257
  %259 = load i32, ptr %24, align 4, !tbaa !5
  %260 = load i32, ptr @R, align 4, !tbaa !5
  %261 = icmp slt i32 %259, %260
  br i1 %261, label %263, label %262

262:                                              ; preds = %258
  store i32 27, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %24) #7
  br label %291

263:                                              ; preds = %258
  %264 = load i32, ptr %24, align 4, !tbaa !5
  %265 = sext i32 %264 to i64
  %266 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %265
  %267 = load i32, ptr %266, align 4, !tbaa !5
  %268 = sext i32 %267 to i64
  %269 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %268
  %270 = load i32, ptr %269, align 4, !tbaa !5
  %271 = icmp ne i32 %270, 0
  br i1 %271, label %272, label %287

272:                                              ; preds = %263
  %273 = load i32, ptr %24, align 4, !tbaa !5
  %274 = sext i32 %273 to i64
  %275 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %274
  %276 = load i32, ptr %275, align 4, !tbaa !5
  %277 = load i32, ptr %8, align 4, !tbaa !5
  %278 = sext i32 %277 to i64
  %279 = getelementptr inbounds [2 x [100010 x i32]], ptr @out, i64 0, i64 %278
  %280 = load i32, ptr %8, align 4, !tbaa !5
  %281 = sext i32 %280 to i64
  %282 = getelementptr inbounds [2 x i32], ptr @ans, i64 0, i64 %281
  %283 = load i32, ptr %282, align 4, !tbaa !5
  %284 = add nsw i32 %283, 1
  store i32 %284, ptr %282, align 4, !tbaa !5
  %285 = sext i32 %283 to i64
  %286 = getelementptr inbounds [100010 x i32], ptr %279, i64 0, i64 %285
  store i32 %276, ptr %286, align 4, !tbaa !5
  br label %287

287:                                              ; preds = %272, %263
  br label %288

288:                                              ; preds = %287
  %289 = load i32, ptr %24, align 4, !tbaa !5
  %290 = add nsw i32 %289, 1
  store i32 %290, ptr %24, align 4, !tbaa !5
  br label %258, !llvm.loop !25

291:                                              ; preds = %262
  br label %296

292:                                              ; preds = %226
  %293 = load i32, ptr %8, align 4, !tbaa !5
  %294 = sext i32 %293 to i64
  %295 = getelementptr inbounds [2 x i32], ptr @ans, i64 0, i64 %294
  store i32 -1, ptr %295, align 4, !tbaa !5
  store i32 7, ptr %9, align 4
  br label %297

296:                                              ; preds = %291
  store i32 0, ptr %9, align 4
  br label %297

297:                                              ; preds = %296, %292
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #7
  %298 = load i32, ptr %9, align 4
  switch i32 %298, label %304 [
    i32 0, label %299
  ]

299:                                              ; preds = %297
  br label %300

300:                                              ; preds = %299, %59
  br label %301

301:                                              ; preds = %300
  %302 = load i32, ptr %10, align 4, !tbaa !5
  %303 = add nsw i32 %302, 1
  store i32 %303, ptr %10, align 4, !tbaa !5
  br label %54, !llvm.loop !26

304:                                              ; preds = %297, %58
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #7
  br label %305

305:                                              ; preds = %304
  br label %306

306:                                              ; preds = %305
  %307 = load i32, ptr %8, align 4, !tbaa !5
  %308 = add nsw i32 %307, 1
  store i32 %308, ptr %8, align 4, !tbaa !5
  br label %49, !llvm.loop !27

309:                                              ; preds = %52
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #7
  %310 = load i32, ptr @ans, align 4, !tbaa !5
  %311 = icmp eq i32 %310, -1
  br i1 %311, label %321, label %312

312:                                              ; preds = %309
  %313 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @ans, i64 0, i64 1), align 4, !tbaa !5
  %314 = icmp ne i32 %313, -1
  br i1 %314, label %315, label %319

315:                                              ; preds = %312
  %316 = load i32, ptr @ans, align 4, !tbaa !5
  %317 = load i32, ptr getelementptr inbounds ([2 x i32], ptr @ans, i64 0, i64 1), align 4, !tbaa !5
  %318 = icmp sgt i32 %316, %317
  br label %319

319:                                              ; preds = %315, %312
  %320 = phi i1 [ false, %312 ], [ %318, %315 ]
  br label %321

321:                                              ; preds = %319, %309
  %322 = phi i1 [ true, %309 ], [ %320, %319 ]
  %323 = zext i1 %322 to i32
  store i32 %323, ptr %25, align 4, !tbaa !5
  %324 = load i32, ptr %25, align 4, !tbaa !5
  %325 = sext i32 %324 to i64
  %326 = getelementptr inbounds [2 x i32], ptr @ans, i64 0, i64 %325
  %327 = load i32, ptr %326, align 4, !tbaa !5
  %328 = call i32 (ptr, ...) @printf(ptr noundef @.str.2, i32 noundef %327)
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #7
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %329

329:                                              ; preds = %357, %321
  %330 = load i32, ptr %26, align 4, !tbaa !5
  %331 = load i32, ptr %25, align 4, !tbaa !5
  %332 = sext i32 %331 to i64
  %333 = getelementptr inbounds [2 x i32], ptr @ans, i64 0, i64 %332
  %334 = load i32, ptr %333, align 4, !tbaa !5
  %335 = icmp slt i32 %330, %334
  br i1 %335, label %337, label %336

336:                                              ; preds = %329
  store i32 30, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #7
  br label %360

337:                                              ; preds = %329
  %338 = load i32, ptr %25, align 4, !tbaa !5
  %339 = sext i32 %338 to i64
  %340 = getelementptr inbounds [2 x [100010 x i32]], ptr @out, i64 0, i64 %339
  %341 = load i32, ptr %26, align 4, !tbaa !5
  %342 = sext i32 %341 to i64
  %343 = getelementptr inbounds [100010 x i32], ptr %340, i64 0, i64 %342
  %344 = load i32, ptr %343, align 4, !tbaa !5
  %345 = load i32, ptr %26, align 4, !tbaa !5
  %346 = load i32, ptr %25, align 4, !tbaa !5
  %347 = sext i32 %346 to i64
  %348 = getelementptr inbounds [2 x i32], ptr @ans, i64 0, i64 %347
  %349 = load i32, ptr %348, align 4, !tbaa !5
  %350 = sub nsw i32 %349, 1
  %351 = icmp eq i32 %345, %350
  %352 = zext i1 %351 to i64
  %353 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %352
  %354 = load i8, ptr %353, align 1, !tbaa !9
  %355 = sext i8 %354 to i32
  %356 = call i32 (ptr, ...) @printf(ptr noundef @.str.3, i32 noundef %344, i32 noundef %355)
  br label %357

357:                                              ; preds = %337
  %358 = load i32, ptr %26, align 4, !tbaa !5
  %359 = add nsw i32 %358, 1
  store i32 %359, ptr %26, align 4, !tbaa !5
  br label %329, !llvm.loop !28

360:                                              ; preds = %336
  store i32 0, ptr %1, align 4
  store i32 1, ptr %9, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #7
  %361 = load i32, ptr %1, align 4
  ret i32 %361
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) #3 align 2

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

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

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

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

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

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

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

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

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

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


; 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"

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

@n = external dso_local global i32, align 4
@m = external dso_local global i32, align 4
@L = external dso_local local_unnamed_addr global i32, align 4
@R = external dso_local local_unnamed_addr global i32, align 4
@que = external dso_local local_unnamed_addr global [100010 x i32], align 16
@col = external dso_local local_unnamed_addr global [100010 x i32], align 16
@ans = external dso_local local_unnamed_addr global [2 x i32], align 4
@out = external dso_local local_unnamed_addr global [2 x [100010 x i32]], align 16
@e = external dso_local global [100010 x %"class.std::vector"], align 16
@vis = external dso_local local_unnamed_addr global [100010 x i8], align 16
@.str = external hidden unnamed_addr constant [5 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [7 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [4 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [5 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca [2 x i8], align 1
  %5 = alloca %"struct.std::pair", align 8
  %6 = alloca %"struct.std::pair", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = tail call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull @n, ptr noundef nonnull @m)
  %12 = load i32, ptr @m, align 4, !tbaa !5
  %13 = add nsw i32 %12, -1
  store i32 %13, ptr @m, align 4, !tbaa !5
  %.not88 = icmp eq i32 %12, 0
  br i1 %.not88, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %0, %.lr.ph
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.start.p0(i64 2, ptr nonnull %4) #7
  %14 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %1, ptr noundef nonnull %2, ptr noundef nonnull %4)
  %15 = load i8, ptr %4, align 1, !tbaa !9
  %16 = icmp eq i8 %15, 66
  %17 = zext i1 %16 to i32
  store i32 %17, ptr %3, align 4, !tbaa !5
  %18 = load i32, ptr %1, align 4, !tbaa !5
  %19 = sext i32 %18 to i64
  %20 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %19
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #7
  %21 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %2, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %21, ptr %5, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %20, ptr noundef nonnull align 4 dereferenceable(8) %5)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #7
  %22 = load i32, ptr %2, align 4, !tbaa !5
  %23 = sext i32 %22 to i64
  %24 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #7
  %25 = call i64 @_ZSt9make_pairIRiS0_ESt4pairINSt25__strip_reference_wrapperINSt5decayIT_E4typeEE6__typeENS2_INS3_IT0_E4typeEE6__typeEEOS4_OS9_(ptr noundef nonnull align 4 dereferenceable(4) %1, ptr noundef nonnull align 4 dereferenceable(4) %3)
  store i64 %25, ptr %6, align 8
  call void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 4 dereferenceable(8) %6)
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #7
  call void @llvm.lifetime.end.p0(i64 2, ptr nonnull %4) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #7
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #7
  %26 = load i32, ptr @m, align 4, !tbaa !5
  %27 = add nsw i32 %26, -1
  store i32 %27, ptr @m, align 4, !tbaa !5
  %.not = icmp eq i32 %26, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !10

._crit_edge:                                      ; preds = %.lr.ph, %0
  store i32 0, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4, !tbaa !5
  store i32 0, ptr @ans, align 4, !tbaa !5
  %28 = load i32, ptr @n, align 4, !tbaa !5
  %29 = icmp slt i32 %28, 1
  br i1 %29, label %.split128.us.thread, label %.split

.split128.us.thread:                              ; preds = %._crit_edge
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100010) @vis, i8 0, i64 100010, i1 false)
  br label %203

.split128.us:                                     ; preds = %.loopexit86
  %.pre159 = load i32, ptr @ans, align 4
  %30 = icmp eq i32 %.pre159, -1
  br i1 %30, label %210, label %203

.splitthread-pre-split:                           ; preds = %.loopexit86
  %.pr = load i32, ptr @n, align 4, !tbaa !5
  br label %.split

.split:                                           ; preds = %._crit_edge, %.splitthread-pre-split
  %31 = phi i32 [ %.pr, %.splitthread-pre-split ], [ %28, %._crit_edge ]
  %32 = phi i1 [ false, %.splitthread-pre-split ], [ true, %._crit_edge ]
  %indvars.iv153 = phi i64 [ 1, %.splitthread-pre-split ], [ 0, %._crit_edge ]
  call void @llvm.memset.p0.i64(ptr noundef nonnull align 16 dereferenceable(100010) @vis, i8 0, i64 100010, i1 false)
  %.not72121 = icmp slt i32 %31, 1
  br i1 %.not72121, label %.loopexit86, label %.lr.ph124

.lr.ph124:                                        ; preds = %.split
  %33 = getelementptr inbounds [2 x i32], ptr @ans, i64 0, i64 %indvars.iv153
  %34 = trunc nuw nsw i64 %indvars.iv153 to i32
  br label %35

35:                                               ; preds = %.lr.ph124, %._crit_edge120
  %indvars.iv150 = phi i64 [ 1, %.lr.ph124 ], [ %indvars.iv.next151, %._crit_edge120 ]
  %36 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %indvars.iv150
  %37 = load i8, ptr %36, align 1, !tbaa !12, !range !14, !noundef !15
  %38 = trunc nuw i8 %37 to i1
  br i1 %38, label %._crit_edge120, label %.lr.ph93.preheader

.lr.ph93.preheader:                               ; preds = %35
  store i32 1, ptr @R, align 4, !tbaa !5
  %39 = trunc nuw nsw i64 %indvars.iv150 to i32
  store i32 %39, ptr @que, align 16, !tbaa !5
  store i8 1, ptr %36, align 1, !tbaa !12
  br label %.lr.ph93

.lr.ph93:                                         ; preds = %.lr.ph93.preheader, %._crit_edge91
  %40 = phi i32 [ %50, %._crit_edge91 ], [ 0, %.lr.ph93.preheader ]
  %41 = add nsw i32 %40, 1
  store i32 %41, ptr @L, align 4, !tbaa !5
  %42 = sext i32 %40 to i64
  %43 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %42
  %44 = load i32, ptr %43, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #7
  %45 = sext i32 %44 to i64
  %46 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %45
  %47 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #7
  store ptr %47, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %48 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #7
  store ptr %48, ptr %8, align 8
  %49 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %49, label %.lr.ph90, label %._crit_edge91

._crit_edge91:                                    ; preds = %70, %.lr.ph93
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #7
  %50 = load i32, ptr @L, align 4, !tbaa !5
  %51 = load i32, ptr @R, align 4, !tbaa !5
  %52 = icmp slt i32 %50, %51
  br i1 %52, label %.lr.ph93, label %._crit_edge94, !llvm.loop !16

.lr.ph90:                                         ; preds = %.lr.ph93, %70
  %53 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %54 = load i32, ptr %53, align 4, !tbaa !17
  %55 = sext i32 %54 to i64
  %56 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %55
  %57 = load i8, ptr %56, align 1, !tbaa !12, !range !14, !noundef !15
  %58 = trunc nuw i8 %57 to i1
  br i1 %58, label %70, label %59

59:                                               ; preds = %.lr.ph90
  %60 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %61 = load i32, ptr %60, align 4, !tbaa !17
  %62 = load i32, ptr @R, align 4, !tbaa !5
  %63 = add nsw i32 %62, 1
  store i32 %63, ptr @R, align 4, !tbaa !5
  %64 = sext i32 %62 to i64
  %65 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %64
  store i32 %61, ptr %65, align 4, !tbaa !5
  %66 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  %67 = load i32, ptr %66, align 4, !tbaa !17
  %68 = sext i32 %67 to i64
  %69 = getelementptr inbounds [100010 x i8], ptr @vis, i64 0, i64 %68
  store i8 1, ptr %69, align 1, !tbaa !12
  br label %70

70:                                               ; preds = %.lr.ph90, %59
  %71 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #7
  %72 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %46) #7
  store ptr %72, ptr %8, align 8
  %73 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #7
  br i1 %73, label %.lr.ph90, label %._crit_edge91, !llvm.loop !19

._crit_edge94:                                    ; preds = %._crit_edge91
  %.pre = load i32, ptr @que, align 16, !tbaa !5
  %74 = sext i32 %.pre to i64
  %75 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %74
  store i32 0, ptr %75, align 4, !tbaa !5
  %76 = icmp sgt i32 %51, 1
  br i1 %76, label %.lr.ph97.preheader, label %.preheader85

.lr.ph97.preheader:                               ; preds = %._crit_edge94
  %wide.trip.count = zext nneg i32 %51 to i64
  %77 = add nsw i64 %wide.trip.count, -1
  %78 = add nsw i64 %wide.trip.count, -2
  %xtraiter = and i64 %77, 3
  %79 = icmp ult i64 %78, 3
  br i1 %79, label %.preheader85.loopexit.unr-lcssa, label %.lr.ph97.preheader.new

.lr.ph97.preheader.new:                           ; preds = %.lr.ph97.preheader
  %unroll_iter = and i64 %77, -4
  br label %.lr.ph97

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

.lr.ph97.epil:                                    ; preds = %.preheader85.loopexit.unr-lcssa, %.lr.ph97.epil
  %indvars.iv.epil = phi i64 [ %indvars.iv.next.epil, %.lr.ph97.epil ], [ %indvars.iv.unr, %.preheader85.loopexit.unr-lcssa ]
  %epil.iter = phi i64 [ %epil.iter.next, %.lr.ph97.epil ], [ 0, %.preheader85.loopexit.unr-lcssa ]
  %80 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv.epil
  %81 = load i32, ptr %80, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %82
  store i32 -1, ptr %83, align 4, !tbaa !5
  %indvars.iv.next.epil = add nuw nsw i64 %indvars.iv.epil, 1
  %epil.iter.next = add i64 %epil.iter, 1
  %epil.iter.cmp.not = icmp eq i64 %epil.iter.next, %xtraiter
  br i1 %epil.iter.cmp.not, label %.preheader85, label %.lr.ph97.epil, !llvm.loop !20

.preheader85:                                     ; preds = %.preheader85.loopexit.unr-lcssa, %.lr.ph97.epil, %._crit_edge94
  %84 = icmp sgt i32 %51, 0
  br i1 %84, label %.lr.ph110, label %._crit_edge120

.lr.ph97:                                         ; preds = %.lr.ph97, %.lr.ph97.preheader.new
  %indvars.iv = phi i64 [ 1, %.lr.ph97.preheader.new ], [ %indvars.iv.next.3, %.lr.ph97 ]
  %niter = phi i64 [ 0, %.lr.ph97.preheader.new ], [ %niter.next.3, %.lr.ph97 ]
  %85 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv
  %86 = load i32, ptr %85, align 4, !tbaa !5
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %87
  store i32 -1, ptr %88, align 4, !tbaa !5
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %89 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv.next
  %90 = load i32, ptr %89, align 4, !tbaa !5
  %91 = sext i32 %90 to i64
  %92 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %91
  store i32 -1, ptr %92, align 4, !tbaa !5
  %indvars.iv.next.1 = add nuw nsw i64 %indvars.iv, 2
  %93 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv.next.1
  %94 = load i32, ptr %93, align 4, !tbaa !5
  %95 = sext i32 %94 to i64
  %96 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %95
  store i32 -1, ptr %96, align 4, !tbaa !5
  %indvars.iv.next.2 = add nuw nsw i64 %indvars.iv, 3
  %97 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv.next.2
  %98 = load i32, ptr %97, align 4, !tbaa !5
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %99
  store i32 -1, ptr %100, align 4, !tbaa !5
  %indvars.iv.next.3 = add nuw nsw i64 %indvars.iv, 4
  %niter.next.3 = add i64 %niter, 4
  %niter.ncmp.3 = icmp eq i64 %niter.next.3, %unroll_iter
  br i1 %niter.ncmp.3, label %.preheader85.loopexit.unr-lcssa, label %.lr.ph97, !llvm.loop !22

._crit_edge111:                                   ; preds = %._crit_edge101
  %.not73.not = icmp eq i32 %.3, 0
  br i1 %.not73.not, label %.thread84, label %134

.lr.ph110:                                        ; preds = %.preheader85, %._crit_edge101
  %indvars.iv137 = phi i64 [ %indvars.iv.next138, %._crit_edge101 ], [ 0, %.preheader85 ]
  %.061108 = phi i32 [ %.3, %._crit_edge101 ], [ 1, %.preheader85 ]
  %.063107 = phi i32 [ %.164.lcssa, %._crit_edge101 ], [ 0, %.preheader85 ]
  %101 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv137
  %102 = load i32, ptr %101, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %103 = sext i32 %102 to i64
  %104 = getelementptr inbounds [100010 x %"class.std::vector"], ptr @e, i64 0, i64 %103
  %105 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  store ptr %105, ptr %9, align 8
  %106 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %103
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %107 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  store ptr %107, ptr %10, align 8
  %108 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br i1 %108, label %.lr.ph100, label %._crit_edge101

.lr.ph100:                                        ; preds = %.lr.ph110, %127
  %.16498 = phi i32 [ %.36682, %127 ], [ %.063107, %.lr.ph110 ]
  %109 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %110 = load i32, ptr %109, align 4, !tbaa !17
  %111 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %112 = getelementptr inbounds i8, ptr %111, i64 4
  %113 = load i32, ptr %112, align 4, !tbaa !23
  %114 = sext i32 %110 to i64
  %115 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %114
  %116 = load i32, ptr %115, align 4, !tbaa !5
  %117 = icmp eq i32 %116, -1
  %118 = load i32, ptr %106, align 4, !tbaa !5
  br i1 %117, label %.thread, label %123

.thread:                                          ; preds = %.lr.ph100
  %119 = xor i32 %118, %113
  %120 = xor i32 %119, %34
  store i32 %120, ptr %115, align 4, !tbaa !5
  %121 = zext i32 %119 to i64
  %.not76 = icmp ne i64 %indvars.iv153, %121
  %122 = zext i1 %.not76 to i32
  %spec.select = add nsw i32 %.16498, %122
  br label %127

123:                                              ; preds = %.lr.ph100
  %124 = xor i32 %113, %118
  %125 = xor i32 %124, %116
  %126 = zext i32 %125 to i64
  %.not75 = icmp eq i64 %indvars.iv153, %126
  br i1 %.not75, label %127, label %._crit_edge101

127:                                              ; preds = %.thread, %123
  %.36682 = phi i32 [ %spec.select, %.thread ], [ %.16498, %123 ]
  %128 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt4pairIiiESt6vectorIS2_SaIS2_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %129 = call ptr @_ZNSt6vectorISt4pairIiiESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %104) #7
  store ptr %129, ptr %10, align 8
  %130 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt4pairIiiESt6vectorIS2_SaIS2_EEEEbRKNS_17__normal_iteratorIT_T0_EESC_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  br i1 %130, label %.lr.ph100, label %._crit_edge101, !llvm.loop !24

._crit_edge101:                                   ; preds = %123, %127, %.lr.ph110
  %.164.lcssa = phi i32 [ %.063107, %.lr.ph110 ], [ %.36682, %127 ], [ %.16498, %123 ]
  %.3 = phi i32 [ %.061108, %.lr.ph110 ], [ %.061108, %127 ], [ 0, %123 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  %indvars.iv.next138 = add nuw nsw i64 %indvars.iv137, 1
  %131 = load i32, ptr @R, align 4, !tbaa !5
  %132 = sext i32 %131 to i64
  %133 = icmp slt i64 %indvars.iv.next138, %132
  br i1 %133, label %.lr.ph110, label %._crit_edge111, !llvm.loop !25

134:                                              ; preds = %._crit_edge111
  %135 = sub nsw i32 %131, %.164.lcssa
  %136 = icmp sgt i32 %.164.lcssa, %135
  %137 = icmp sgt i32 %131, 0
  %or.cond = and i1 %136, %137
  br i1 %or.cond, label %.lr.ph116.preheader, label %.loopexit

.lr.ph116.preheader:                              ; preds = %134
  %wide.trip.count143 = zext nneg i32 %131 to i64
  %xtraiter175 = and i64 %wide.trip.count143, 3
  %138 = icmp ult i32 %131, 4
  br i1 %138, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph116.preheader.new

.lr.ph116.preheader.new:                          ; preds = %.lr.ph116.preheader
  %unroll_iter178 = and i64 %wide.trip.count143, 2147483644
  br label %.lr.ph116

.lr.ph116:                                        ; preds = %.lr.ph116, %.lr.ph116.preheader.new
  %indvars.iv140 = phi i64 [ 0, %.lr.ph116.preheader.new ], [ %indvars.iv.next141.3, %.lr.ph116 ]
  %niter179 = phi i64 [ 0, %.lr.ph116.preheader.new ], [ %niter179.next.3, %.lr.ph116 ]
  %139 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv140
  %140 = load i32, ptr %139, align 16, !tbaa !5
  %141 = sext i32 %140 to i64
  %142 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %141
  %143 = load i32, ptr %142, align 4, !tbaa !5
  %144 = xor i32 %143, 1
  store i32 %144, ptr %142, align 4, !tbaa !5
  %indvars.iv.next141 = or disjoint i64 %indvars.iv140, 1
  %145 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv.next141
  %146 = load i32, ptr %145, align 4, !tbaa !5
  %147 = sext i32 %146 to i64
  %148 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %147
  %149 = load i32, ptr %148, align 4, !tbaa !5
  %150 = xor i32 %149, 1
  store i32 %150, ptr %148, align 4, !tbaa !5
  %indvars.iv.next141.1 = or disjoint i64 %indvars.iv140, 2
  %151 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv.next141.1
  %152 = load i32, ptr %151, align 8, !tbaa !5
  %153 = sext i32 %152 to i64
  %154 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %153
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = xor i32 %155, 1
  store i32 %156, ptr %154, align 4, !tbaa !5
  %indvars.iv.next141.2 = or disjoint i64 %indvars.iv140, 3
  %157 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv.next141.2
  %158 = load i32, ptr %157, align 4, !tbaa !5
  %159 = sext i32 %158 to i64
  %160 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %159
  %161 = load i32, ptr %160, align 4, !tbaa !5
  %162 = xor i32 %161, 1
  store i32 %162, ptr %160, align 4, !tbaa !5
  %indvars.iv.next141.3 = add nuw nsw i64 %indvars.iv140, 4
  %niter179.next.3 = add i64 %niter179, 4
  %niter179.ncmp.3 = icmp eq i64 %niter179.next.3, %unroll_iter178
  br i1 %niter179.ncmp.3, label %.loopexit.loopexit.unr-lcssa, label %.lr.ph116, !llvm.loop !26

.loopexit.loopexit.unr-lcssa:                     ; preds = %.lr.ph116, %.lr.ph116.preheader
  %indvars.iv140.unr = phi i64 [ 0, %.lr.ph116.preheader ], [ %indvars.iv.next141.3, %.lr.ph116 ]
  %lcmp.mod177.not = icmp eq i64 %xtraiter175, 0
  br i1 %lcmp.mod177.not, label %.loopexit, label %.lr.ph116.epil

.lr.ph116.epil:                                   ; preds = %.loopexit.loopexit.unr-lcssa, %.lr.ph116.epil
  %indvars.iv140.epil = phi i64 [ %indvars.iv.next141.epil, %.lr.ph116.epil ], [ %indvars.iv140.unr, %.loopexit.loopexit.unr-lcssa ]
  %epil.iter176 = phi i64 [ %epil.iter176.next, %.lr.ph116.epil ], [ 0, %.loopexit.loopexit.unr-lcssa ]
  %163 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv140.epil
  %164 = load i32, ptr %163, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %165
  %167 = load i32, ptr %166, align 4, !tbaa !5
  %168 = xor i32 %167, 1
  store i32 %168, ptr %166, align 4, !tbaa !5
  %indvars.iv.next141.epil = add nuw nsw i64 %indvars.iv140.epil, 1
  %epil.iter176.next = add i64 %epil.iter176, 1
  %epil.iter176.cmp.not = icmp eq i64 %epil.iter176.next, %xtraiter175
  br i1 %epil.iter176.cmp.not, label %.loopexit, label %.lr.ph116.epil, !llvm.loop !27

.loopexit:                                        ; preds = %.loopexit.loopexit.unr-lcssa, %.lr.ph116.epil, %134
  br i1 %137, label %.lr.ph119.preheader, label %._crit_edge120

.lr.ph119.preheader:                              ; preds = %.loopexit
  %wide.trip.count148 = zext nneg i32 %131 to i64
  %xtraiter180 = and i64 %wide.trip.count148, 1
  %169 = icmp eq i32 %131, 1
  br i1 %169, label %._crit_edge120.loopexit.unr-lcssa, label %.lr.ph119.preheader.new

.lr.ph119.preheader.new:                          ; preds = %.lr.ph119.preheader
  %unroll_iter183 = and i64 %wide.trip.count148, 2147483646
  br label %.lr.ph119

.lr.ph119:                                        ; preds = %190, %.lr.ph119.preheader.new
  %indvars.iv145 = phi i64 [ 0, %.lr.ph119.preheader.new ], [ %indvars.iv.next146.1, %190 ]
  %niter184 = phi i64 [ 0, %.lr.ph119.preheader.new ], [ %niter184.next.1, %190 ]
  %170 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv145
  %171 = load i32, ptr %170, align 8, !tbaa !5
  %172 = sext i32 %171 to i64
  %173 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %172
  %174 = load i32, ptr %173, align 4, !tbaa !5
  %.not74 = icmp eq i32 %174, 0
  br i1 %.not74, label %.lr.ph119.1, label %175

175:                                              ; preds = %.lr.ph119
  %176 = load i32, ptr %33, align 4, !tbaa !5
  %177 = add nsw i32 %176, 1
  store i32 %177, ptr %33, align 4, !tbaa !5
  %178 = sext i32 %176 to i64
  %179 = getelementptr inbounds [2 x [100010 x i32]], ptr @out, i64 0, i64 %indvars.iv153, i64 %178
  store i32 %171, ptr %179, align 4, !tbaa !5
  br label %.lr.ph119.1

.lr.ph119.1:                                      ; preds = %.lr.ph119, %175
  %indvars.iv.next146 = or disjoint i64 %indvars.iv145, 1
  %180 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv.next146
  %181 = load i32, ptr %180, align 4, !tbaa !5
  %182 = sext i32 %181 to i64
  %183 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %182
  %184 = load i32, ptr %183, align 4, !tbaa !5
  %.not74.1 = icmp eq i32 %184, 0
  br i1 %.not74.1, label %190, label %185

185:                                              ; preds = %.lr.ph119.1
  %186 = load i32, ptr %33, align 4, !tbaa !5
  %187 = add nsw i32 %186, 1
  store i32 %187, ptr %33, align 4, !tbaa !5
  %188 = sext i32 %186 to i64
  %189 = getelementptr inbounds [2 x [100010 x i32]], ptr @out, i64 0, i64 %indvars.iv153, i64 %188
  store i32 %181, ptr %189, align 4, !tbaa !5
  br label %190

190:                                              ; preds = %185, %.lr.ph119.1
  %indvars.iv.next146.1 = add nuw nsw i64 %indvars.iv145, 2
  %niter184.next.1 = add i64 %niter184, 2
  %niter184.ncmp.1 = icmp eq i64 %niter184.next.1, %unroll_iter183
  br i1 %niter184.ncmp.1, label %._crit_edge120.loopexit.unr-lcssa, label %.lr.ph119, !llvm.loop !28

.thread84:                                        ; preds = %._crit_edge111
  store i32 -1, ptr %33, align 4, !tbaa !5
  br label %.loopexit86

._crit_edge120.loopexit.unr-lcssa:                ; preds = %190, %.lr.ph119.preheader
  %indvars.iv145.unr = phi i64 [ 0, %.lr.ph119.preheader ], [ %indvars.iv.next146.1, %190 ]
  %lcmp.mod182.not = icmp eq i64 %xtraiter180, 0
  br i1 %lcmp.mod182.not, label %._crit_edge120, label %.lr.ph119.epil

.lr.ph119.epil:                                   ; preds = %._crit_edge120.loopexit.unr-lcssa
  %191 = getelementptr inbounds [100010 x i32], ptr @que, i64 0, i64 %indvars.iv145.unr
  %192 = load i32, ptr %191, align 4, !tbaa !5
  %193 = sext i32 %192 to i64
  %194 = getelementptr inbounds [100010 x i32], ptr @col, i64 0, i64 %193
  %195 = load i32, ptr %194, align 4, !tbaa !5
  %.not74.epil = icmp eq i32 %195, 0
  br i1 %.not74.epil, label %._crit_edge120, label %196

196:                                              ; preds = %.lr.ph119.epil
  %197 = load i32, ptr %33, align 4, !tbaa !5
  %198 = add nsw i32 %197, 1
  store i32 %198, ptr %33, align 4, !tbaa !5
  %199 = sext i32 %197 to i64
  %200 = getelementptr inbounds [2 x [100010 x i32]], ptr @out, i64 0, i64 %indvars.iv153, i64 %199
  store i32 %192, ptr %200, align 4, !tbaa !5
  br label %._crit_edge120

._crit_edge120:                                   ; preds = %._crit_edge120.loopexit.unr-lcssa, %196, %.lr.ph119.epil, %.preheader85, %.loopexit, %35
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %201 = load i32, ptr @n, align 4, !tbaa !5
  %202 = sext i32 %201 to i64
  %.not72.not = icmp slt i64 %indvars.iv150, %202
  br i1 %.not72.not, label %35, label %.loopexit86, !llvm.loop !29

.loopexit86:                                      ; preds = %._crit_edge120, %.split, %.thread84
  br i1 %32, label %.splitthread-pre-split, label %.split128.us, !llvm.loop !30

203:                                              ; preds = %.split128.us.thread, %.split128.us
  %204 = phi i32 [ 0, %.split128.us.thread ], [ %.pre159, %.split128.us ]
  %205 = load i32, ptr getelementptr inbounds (i8, ptr @ans, i64 4), align 4
  %206 = icmp ne i32 %205, -1
  %207 = icmp sgt i32 %204, %205
  %208 = and i1 %206, %207
  %209 = zext i1 %208 to i64
  br label %210

210:                                              ; preds = %203, %.split128.us
  %211 = phi i64 [ 1, %.split128.us ], [ %209, %203 ]
  %212 = getelementptr inbounds [2 x i32], ptr @ans, i64 0, i64 %211
  %213 = load i32, ptr %212, align 4, !tbaa !5
  %214 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.2, i32 noundef %213)
  %215 = load i32, ptr %212, align 4, !tbaa !5
  %216 = icmp sgt i32 %215, 0
  br i1 %216, label %.lr.ph131, label %._crit_edge132

._crit_edge132:                                   ; preds = %.lr.ph131, %210
  ret i32 0

.lr.ph131:                                        ; preds = %210, %.lr.ph131
  %indvars.iv156 = phi i64 [ %indvars.iv.next157, %.lr.ph131 ], [ 0, %210 ]
  %217 = phi i32 [ %228, %.lr.ph131 ], [ %215, %210 ]
  %218 = getelementptr inbounds [2 x [100010 x i32]], ptr @out, i64 0, i64 %211, i64 %indvars.iv156
  %219 = load i32, ptr %218, align 4, !tbaa !5
  %220 = add nsw i32 %217, -1
  %221 = zext i32 %220 to i64
  %222 = icmp eq i64 %indvars.iv156, %221
  %223 = zext i1 %222 to i64
  %224 = getelementptr inbounds [3 x i8], ptr @.str.4, i64 0, i64 %223
  %225 = load i8, ptr %224, align 1, !tbaa !9
  %226 = sext i8 %225 to i32
  %227 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i32 noundef %219, i32 noundef %226)
  %indvars.iv.next157 = add nuw nsw i64 %indvars.iv156, 1
  %228 = load i32, ptr %212, align 4, !tbaa !5
  %229 = sext i32 %228 to i64
  %230 = icmp slt i64 %indvars.iv.next157, %229
  br i1 %230, label %.lr.ph131, label %._crit_edge132, !llvm.loop !32
}

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorISt4pairIiiESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 4 dereferenceable(8)) local_unnamed_addr #3 align 2

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

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

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

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

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

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

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

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

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

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


; Effective O3 passes: ADCEPass,ConstraintEliminationPass,CorrelatedValuePropagationPass,DSEPass,EarlyCSEPass,GVNPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferAlignmentPass,InferFunctionAttrsPass,InstCombinePass,InstSimplifyPass,JumpThreadingPass,LCSSAPass,LICMPass,LoopInstSimplifyPass,LoopRotatePass,LoopSimplifyCFGPass,LoopSimplifyPass,LoopUnrollPass,MemCpyOptPass,ReassociatePass,SCCPPass,SROAPass,SimpleLoopUnswitchPass,SimplifyCFGPass,TailCallElimPass