; LLVM IR from ShahjalalShohag/code-library :: Data Structures (Permutation Tree)

; Unoptimized IR (clang -disable-llvm-passes):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

%"struct.std::pair" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@p = external dso_local global [100009 x i32], align 16
@span = external dso_local global [200018 x %"struct.std::pair"], align 16
@pt = external dso_local global [200018 x %"class.std::vector"], align 16
@ty = external dso_local global [200018 x i32], align 16
@P = external dso_local global [200018 x [19 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = alloca i32, align 4
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  %14 = call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %15 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %16 = getelementptr i8, ptr %15, i64 -24
  %17 = load i64, ptr %16, align 8
  %18 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %17
  %19 = call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %18, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #6
  %20 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 4, ptr %3) #6
  store i32 1, ptr %3, align 4, !tbaa !8
  br label %21

21:                                               ; preds = %31, %0
  %22 = load i32, ptr %3, align 4, !tbaa !8
  %23 = load i32, ptr %2, align 4, !tbaa !8
  %24 = icmp sle i32 %22, %23
  br i1 %24, label %26, label %25

25:                                               ; preds = %21
  call void @llvm.lifetime.end.p0(i64 4, ptr %3) #6
  br label %34

26:                                               ; preds = %21
  %27 = load i32, ptr %3, align 4, !tbaa !8
  %28 = sext i32 %27 to i64
  %29 = getelementptr inbounds [100009 x i32], ptr @p, i64 0, i64 %28
  %30 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %29)
  br label %31

31:                                               ; preds = %26
  %32 = load i32, ptr %3, align 4, !tbaa !8
  %33 = add nsw i32 %32, 1
  store i32 %33, ptr %3, align 4, !tbaa !8
  br label %21, !llvm.loop !11

34:                                               ; preds = %25
  call void @llvm.lifetime.start.p0(i64 4, ptr %4) #6
  %35 = load i32, ptr %2, align 4, !tbaa !8
  %36 = call noundef i32 @_Z5buildi(i32 noundef %35)
  store i32 %36, ptr %4, align 4, !tbaa !8
  %37 = load i32, ptr %4, align 4, !tbaa !8
  call void @_Z3dfsii(i32 noundef %37, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr %5) #6
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %5)
  br label %39

39:                                               ; preds = %230, %228, %34
  %40 = load i32, ptr %5, align 4, !tbaa !8
  %41 = add nsw i32 %40, -1
  store i32 %41, ptr %5, align 4, !tbaa !8
  %42 = icmp ne i32 %40, 0
  br i1 %42, label %43, label %231

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 4, ptr %6) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #6
  %44 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %6)
  %45 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %44, ptr noundef nonnull align 4 dereferenceable(4) %7)
  %46 = load i32, ptr %6, align 4, !tbaa !8
  %47 = load i32, ptr %7, align 4, !tbaa !8
  %48 = icmp eq i32 %46, %47
  br i1 %48, label %49, label %56

49:                                               ; preds = %43
  %50 = load i32, ptr %6, align 4, !tbaa !8
  %51 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %50)
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %51, i8 noundef signext 32)
  %53 = load i32, ptr %7, align 4, !tbaa !8
  %54 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %52, i32 noundef %53)
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %54, i8 noundef signext 10)
  store i32 5, ptr %8, align 4
  br label %228, !llvm.loop !13

56:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #6
  %57 = load i32, ptr %6, align 4, !tbaa !8
  store i32 %57, ptr %9, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %10) #6
  store i32 18, ptr %10, align 4, !tbaa !8
  br label %58

58:                                               ; preds = %94, %56
  %59 = load i32, ptr %10, align 4, !tbaa !8
  %60 = icmp sge i32 %59, 0
  br i1 %60, label %62, label %61

61:                                               ; preds = %58
  store i32 7, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %10) #6
  br label %97

62:                                               ; preds = %58
  %63 = load i32, ptr %9, align 4, !tbaa !8
  %64 = sext i32 %63 to i64
  %65 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %64
  %66 = load i32, ptr %10, align 4, !tbaa !8
  %67 = sext i32 %66 to i64
  %68 = getelementptr inbounds [19 x i32], ptr %65, i64 0, i64 %67
  %69 = load i32, ptr %68, align 4, !tbaa !8
  %70 = icmp ne i32 %69, 0
  br i1 %70, label %71, label %93

71:                                               ; preds = %62
  %72 = load i32, ptr %9, align 4, !tbaa !8
  %73 = sext i32 %72 to i64
  %74 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %73
  %75 = load i32, ptr %10, align 4, !tbaa !8
  %76 = sext i32 %75 to i64
  %77 = getelementptr inbounds [19 x i32], ptr %74, i64 0, i64 %76
  %78 = load i32, ptr %77, align 4, !tbaa !8
  %79 = sext i32 %78 to i64
  %80 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %79
  %81 = getelementptr inbounds %"struct.std::pair", ptr %80, i32 0, i32 1
  %82 = load i32, ptr %81, align 4, !tbaa !14
  %83 = load i32, ptr %7, align 4, !tbaa !8
  %84 = icmp slt i32 %82, %83
  br i1 %84, label %85, label %93

85:                                               ; preds = %71
  %86 = load i32, ptr %9, align 4, !tbaa !8
  %87 = sext i32 %86 to i64
  %88 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %87
  %89 = load i32, ptr %10, align 4, !tbaa !8
  %90 = sext i32 %89 to i64
  %91 = getelementptr inbounds [19 x i32], ptr %88, i64 0, i64 %90
  %92 = load i32, ptr %91, align 4, !tbaa !8
  store i32 %92, ptr %9, align 4, !tbaa !8
  br label %93

93:                                               ; preds = %85, %71, %62
  br label %94

94:                                               ; preds = %93
  %95 = load i32, ptr %10, align 4, !tbaa !8
  %96 = add nsw i32 %95, -1
  store i32 %96, ptr %10, align 4, !tbaa !8
  br label %58, !llvm.loop !16

97:                                               ; preds = %61
  %98 = load i32, ptr %9, align 4, !tbaa !8
  %99 = sext i32 %98 to i64
  %100 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %99
  %101 = getelementptr inbounds [19 x i32], ptr %100, i64 0, i64 0
  %102 = load i32, ptr %101, align 4, !tbaa !8
  store i32 %102, ptr %9, align 4, !tbaa !8
  %103 = load i32, ptr %9, align 4, !tbaa !8
  %104 = sext i32 %103 to i64
  %105 = getelementptr inbounds [200018 x i32], ptr @ty, i64 0, i64 %104
  %106 = load i32, ptr %105, align 4, !tbaa !8
  %107 = icmp eq i32 %106, 0
  br i1 %107, label %108, label %123

108:                                              ; preds = %97
  %109 = load i32, ptr %9, align 4, !tbaa !8
  %110 = sext i32 %109 to i64
  %111 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %110
  %112 = getelementptr inbounds %"struct.std::pair", ptr %111, i32 0, i32 0
  %113 = load i32, ptr %112, align 8, !tbaa !17
  %114 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %113)
  %115 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %114, i8 noundef signext 32)
  %116 = load i32, ptr %9, align 4, !tbaa !8
  %117 = sext i32 %116 to i64
  %118 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %117
  %119 = getelementptr inbounds %"struct.std::pair", ptr %118, i32 0, i32 1
  %120 = load i32, ptr %119, align 4, !tbaa !14
  %121 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %115, i32 noundef %120)
  %122 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %121, i8 noundef signext 10)
  store i32 5, ptr %8, align 4
  br label %227, !llvm.loop !13

123:                                              ; preds = %97
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #6
  store i32 -1, ptr %11, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #6
  %124 = load i32, ptr %9, align 4, !tbaa !8
  %125 = sext i32 %124 to i64
  %126 = getelementptr inbounds [200018 x %"class.std::vector"], ptr @pt, i64 0, i64 %125
  %127 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %126) #6
  %128 = trunc i64 %127 to i32
  store i32 %128, ptr %12, align 4, !tbaa !8
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #6
  store i32 18, ptr %13, align 4, !tbaa !8
  br label %129

129:                                              ; preds = %195, %123
  %130 = load i32, ptr %13, align 4, !tbaa !8
  %131 = icmp sge i32 %130, 0
  br i1 %131, label %133, label %132

132:                                              ; preds = %129
  store i32 10, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #6
  br label %198

133:                                              ; preds = %129
  %134 = load i32, ptr %11, align 4, !tbaa !8
  %135 = load i32, ptr %13, align 4, !tbaa !8
  %136 = shl i32 1, %135
  %137 = add nsw i32 %134, %136
  %138 = sext i32 %137 to i64
  %139 = load i32, ptr %9, align 4, !tbaa !8
  %140 = sext i32 %139 to i64
  %141 = getelementptr inbounds [200018 x %"class.std::vector"], ptr @pt, i64 0, i64 %140
  %142 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %141) #6
  %143 = icmp ult i64 %138, %142
  br i1 %143, label %144, label %166

144:                                              ; preds = %133
  %145 = load i32, ptr %9, align 4, !tbaa !8
  %146 = sext i32 %145 to i64
  %147 = getelementptr inbounds [200018 x %"class.std::vector"], ptr @pt, i64 0, i64 %146
  %148 = load i32, ptr %11, align 4, !tbaa !8
  %149 = load i32, ptr %13, align 4, !tbaa !8
  %150 = shl i32 1, %149
  %151 = add nsw i32 %148, %150
  %152 = sext i32 %151 to i64
  %153 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %147, i64 noundef %152) #6
  %154 = load i32, ptr %153, align 4, !tbaa !8
  %155 = sext i32 %154 to i64
  %156 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %155
  %157 = getelementptr inbounds %"struct.std::pair", ptr %156, i32 0, i32 1
  %158 = load i32, ptr %157, align 4, !tbaa !14
  %159 = load i32, ptr %6, align 4, !tbaa !8
  %160 = icmp slt i32 %158, %159
  br i1 %160, label %161, label %166

161:                                              ; preds = %144
  %162 = load i32, ptr %13, align 4, !tbaa !8
  %163 = shl i32 1, %162
  %164 = load i32, ptr %11, align 4, !tbaa !8
  %165 = add nsw i32 %164, %163
  store i32 %165, ptr %11, align 4, !tbaa !8
  br label %166

166:                                              ; preds = %161, %144, %133
  %167 = load i32, ptr %12, align 4, !tbaa !8
  %168 = load i32, ptr %13, align 4, !tbaa !8
  %169 = shl i32 1, %168
  %170 = sub nsw i32 %167, %169
  %171 = icmp sge i32 %170, 0
  br i1 %171, label %172, label %194

172:                                              ; preds = %166
  %173 = load i32, ptr %7, align 4, !tbaa !8
  %174 = load i32, ptr %9, align 4, !tbaa !8
  %175 = sext i32 %174 to i64
  %176 = getelementptr inbounds [200018 x %"class.std::vector"], ptr @pt, i64 0, i64 %175
  %177 = load i32, ptr %12, align 4, !tbaa !8
  %178 = load i32, ptr %13, align 4, !tbaa !8
  %179 = shl i32 1, %178
  %180 = sub nsw i32 %177, %179
  %181 = sext i32 %180 to i64
  %182 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %176, i64 noundef %181) #6
  %183 = load i32, ptr %182, align 4, !tbaa !8
  %184 = sext i32 %183 to i64
  %185 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %184
  %186 = getelementptr inbounds %"struct.std::pair", ptr %185, i32 0, i32 0
  %187 = load i32, ptr %186, align 8, !tbaa !17
  %188 = icmp slt i32 %173, %187
  br i1 %188, label %189, label %194

189:                                              ; preds = %172
  %190 = load i32, ptr %13, align 4, !tbaa !8
  %191 = shl i32 1, %190
  %192 = load i32, ptr %12, align 4, !tbaa !8
  %193 = sub nsw i32 %192, %191
  store i32 %193, ptr %12, align 4, !tbaa !8
  br label %194

194:                                              ; preds = %189, %172, %166
  br label %195

195:                                              ; preds = %194
  %196 = load i32, ptr %13, align 4, !tbaa !8
  %197 = add nsw i32 %196, -1
  store i32 %197, ptr %13, align 4, !tbaa !8
  br label %129, !llvm.loop !18

198:                                              ; preds = %132
  %199 = load i32, ptr %9, align 4, !tbaa !8
  %200 = sext i32 %199 to i64
  %201 = getelementptr inbounds [200018 x %"class.std::vector"], ptr @pt, i64 0, i64 %200
  %202 = load i32, ptr %11, align 4, !tbaa !8
  %203 = add nsw i32 %202, 1
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %201, i64 noundef %204) #6
  %206 = load i32, ptr %205, align 4, !tbaa !8
  %207 = sext i32 %206 to i64
  %208 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %207
  %209 = getelementptr inbounds %"struct.std::pair", ptr %208, i32 0, i32 0
  %210 = load i32, ptr %209, align 8, !tbaa !17
  %211 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %210)
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %211, i8 noundef signext 32)
  %213 = load i32, ptr %9, align 4, !tbaa !8
  %214 = sext i32 %213 to i64
  %215 = getelementptr inbounds [200018 x %"class.std::vector"], ptr @pt, i64 0, i64 %214
  %216 = load i32, ptr %12, align 4, !tbaa !8
  %217 = sub nsw i32 %216, 1
  %218 = sext i32 %217 to i64
  %219 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %215, i64 noundef %218) #6
  %220 = load i32, ptr %219, align 4, !tbaa !8
  %221 = sext i32 %220 to i64
  %222 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %221
  %223 = getelementptr inbounds %"struct.std::pair", ptr %222, i32 0, i32 1
  %224 = load i32, ptr %223, align 4, !tbaa !14
  %225 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %212, i32 noundef %224)
  %226 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %225, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #6
  store i32 0, ptr %8, align 4
  br label %227

227:                                              ; preds = %198, %108
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #6
  br label %228

228:                                              ; preds = %227, %49
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %6) #6
  %229 = load i32, ptr %8, align 4
  switch i32 %229, label %233 [
    i32 0, label %230
    i32 5, label %39
  ]

230:                                              ; preds = %228
  br label %39, !llvm.loop !13

231:                                              ; preds = %39
  store i32 0, ptr %1, align 4
  store i32 1, ptr %8, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %5) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #6
  %232 = load i32, ptr %1, align 4
  ret i32 %232

233:                                              ; preds = %228
  unreachable
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) #3

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) #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 = { 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 #3 = { "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 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 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !9, i64 4}
!15 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!16 = distinct !{!16, !12}
!17 = !{!15, !9, i64 0}
!18 = distinct !{!18, !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" = type { i32, i32 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_ostream" = type { ptr, %"class.std::basic_ios" }

@p = external dso_local global [100009 x i32], align 16
@span = external dso_local local_unnamed_addr global [200018 x %"struct.std::pair"], align 16
@pt = external dso_local global [200018 x %"class.std::vector"], align 16
@ty = external dso_local local_unnamed_addr global [200018 x i32], align 16
@P = external dso_local local_unnamed_addr global [200018 x [19 x i32]], align 16
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@_ZSt4cout = external global %"class.std::basic_ostream", align 8

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

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

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

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

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca i32, align 4
  %4 = alloca i32, align 4
  %5 = tail call noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext false)
  %6 = load ptr, ptr @_ZSt3cin, align 8, !tbaa !5
  %7 = getelementptr i8, ptr %6, i64 -24
  %8 = load i64, ptr %7, align 8
  %9 = getelementptr inbounds i8, ptr @_ZSt3cin, i64 %8
  %10 = tail call noundef ptr @_ZNSt9basic_iosIcSt11char_traitsIcEE3tieEPSo(ptr noundef nonnull align 8 dereferenceable(264) %9, ptr noundef null)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #6
  %11 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  %12 = load i32, ptr %1, align 4, !tbaa !8
  %.not56 = icmp slt i32 %12, 1
  br i1 %.not56, label %._crit_edge, label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %0
  %.lcssa = phi i32 [ %12, %0 ], [ %19, %.lr.ph ]
  %13 = call noundef i32 @_Z5buildi(i32 noundef %.lcssa)
  call void @_Z3dfsii(i32 noundef %13, i32 noundef 0)
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %2) #6
  %14 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  %15 = load i32, ptr %2, align 4, !tbaa !8
  %16 = add nsw i32 %15, -1
  store i32 %16, ptr %2, align 4, !tbaa !8
  %.not5263 = icmp eq i32 %15, 0
  br i1 %.not5263, label %._crit_edge66, label %.lr.ph65

.lr.ph:                                           ; preds = %0, %.lr.ph
  %indvars.iv = phi i64 [ %indvars.iv.next, %.lr.ph ], [ 1, %0 ]
  %17 = getelementptr inbounds [100009 x i32], ptr @p, i64 0, i64 %indvars.iv
  %18 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %17)
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %19 = load i32, ptr %1, align 4, !tbaa !8
  %20 = sext i32 %19 to i64
  %.not.not = icmp slt i64 %indvars.iv, %20
  br i1 %.not.not, label %.lr.ph, label %._crit_edge, !llvm.loop !11

.lr.ph65:                                         ; preds = %._crit_edge, %230
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %3) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #6
  %21 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %3)
  %22 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 4 dereferenceable(4) %4)
  %23 = load i32, ptr %3, align 4, !tbaa !8
  %24 = load i32, ptr %4, align 4, !tbaa !8
  %25 = icmp eq i32 %23, %24
  br i1 %25, label %29, label %.preheader.preheader

.preheader.preheader:                             ; preds = %.lr.ph65
  %26 = sext i32 %23 to i64
  %27 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %26, i64 18
  %28 = load i32, ptr %27, align 4, !tbaa !8
  %.not53 = icmp eq i32 %28, 0
  br i1 %.not53, label %.preheader.1, label %34

29:                                               ; preds = %.lr.ph65
  %30 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %23)
  %31 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %30, i8 noundef signext 32)
  %32 = load i32, ptr %4, align 4, !tbaa !8
  %33 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %31, i32 noundef %32)
  br label %230, !llvm.loop !13

34:                                               ; preds = %.preheader.preheader
  %35 = sext i32 %28 to i64
  %36 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %35, i32 1
  %37 = load i32, ptr %36, align 4, !tbaa !14
  %38 = icmp slt i32 %37, %24
  %spec.select = select i1 %38, i32 %28, i32 %23
  %.pre = sext i32 %spec.select to i64
  br label %.preheader.1

.preheader.1:                                     ; preds = %34, %.preheader.preheader
  %.pre-phi = phi i64 [ %.pre, %34 ], [ %26, %.preheader.preheader ]
  %.144 = phi i32 [ %spec.select, %34 ], [ %23, %.preheader.preheader ]
  %39 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi, i64 17
  %40 = load i32, ptr %39, align 4, !tbaa !8
  %.not53.1 = icmp eq i32 %40, 0
  br i1 %.not53.1, label %.preheader.2, label %41

41:                                               ; preds = %.preheader.1
  %42 = sext i32 %40 to i64
  %43 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %42, i32 1
  %44 = load i32, ptr %43, align 4, !tbaa !14
  %45 = icmp slt i32 %44, %24
  %spec.select.1 = select i1 %45, i32 %40, i32 %.144
  %.pre72 = sext i32 %spec.select.1 to i64
  br label %.preheader.2

.preheader.2:                                     ; preds = %41, %.preheader.1
  %.pre-phi73 = phi i64 [ %.pre72, %41 ], [ %.pre-phi, %.preheader.1 ]
  %.144.1 = phi i32 [ %spec.select.1, %41 ], [ %.144, %.preheader.1 ]
  %46 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi73, i64 16
  %47 = load i32, ptr %46, align 4, !tbaa !8
  %.not53.2 = icmp eq i32 %47, 0
  br i1 %.not53.2, label %.preheader.3, label %48

48:                                               ; preds = %.preheader.2
  %49 = sext i32 %47 to i64
  %50 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %49, i32 1
  %51 = load i32, ptr %50, align 4, !tbaa !14
  %52 = icmp slt i32 %51, %24
  %spec.select.2 = select i1 %52, i32 %47, i32 %.144.1
  %.pre74 = sext i32 %spec.select.2 to i64
  br label %.preheader.3

.preheader.3:                                     ; preds = %48, %.preheader.2
  %.pre-phi75 = phi i64 [ %.pre74, %48 ], [ %.pre-phi73, %.preheader.2 ]
  %.144.2 = phi i32 [ %spec.select.2, %48 ], [ %.144.1, %.preheader.2 ]
  %53 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi75, i64 15
  %54 = load i32, ptr %53, align 4, !tbaa !8
  %.not53.3 = icmp eq i32 %54, 0
  br i1 %.not53.3, label %.preheader.4, label %55

55:                                               ; preds = %.preheader.3
  %56 = sext i32 %54 to i64
  %57 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %56, i32 1
  %58 = load i32, ptr %57, align 4, !tbaa !14
  %59 = icmp slt i32 %58, %24
  %spec.select.3 = select i1 %59, i32 %54, i32 %.144.2
  %.pre76 = sext i32 %spec.select.3 to i64
  br label %.preheader.4

.preheader.4:                                     ; preds = %55, %.preheader.3
  %.pre-phi77 = phi i64 [ %.pre76, %55 ], [ %.pre-phi75, %.preheader.3 ]
  %.144.3 = phi i32 [ %spec.select.3, %55 ], [ %.144.2, %.preheader.3 ]
  %60 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi77, i64 14
  %61 = load i32, ptr %60, align 4, !tbaa !8
  %.not53.4 = icmp eq i32 %61, 0
  br i1 %.not53.4, label %.preheader.5, label %62

62:                                               ; preds = %.preheader.4
  %63 = sext i32 %61 to i64
  %64 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %63, i32 1
  %65 = load i32, ptr %64, align 4, !tbaa !14
  %66 = icmp slt i32 %65, %24
  %spec.select.4 = select i1 %66, i32 %61, i32 %.144.3
  %.pre78 = sext i32 %spec.select.4 to i64
  br label %.preheader.5

.preheader.5:                                     ; preds = %62, %.preheader.4
  %.pre-phi79 = phi i64 [ %.pre78, %62 ], [ %.pre-phi77, %.preheader.4 ]
  %.144.4 = phi i32 [ %spec.select.4, %62 ], [ %.144.3, %.preheader.4 ]
  %67 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi79, i64 13
  %68 = load i32, ptr %67, align 4, !tbaa !8
  %.not53.5 = icmp eq i32 %68, 0
  br i1 %.not53.5, label %.preheader.6, label %69

69:                                               ; preds = %.preheader.5
  %70 = sext i32 %68 to i64
  %71 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %70, i32 1
  %72 = load i32, ptr %71, align 4, !tbaa !14
  %73 = icmp slt i32 %72, %24
  %spec.select.5 = select i1 %73, i32 %68, i32 %.144.4
  %.pre80 = sext i32 %spec.select.5 to i64
  br label %.preheader.6

.preheader.6:                                     ; preds = %69, %.preheader.5
  %.pre-phi81 = phi i64 [ %.pre80, %69 ], [ %.pre-phi79, %.preheader.5 ]
  %.144.5 = phi i32 [ %spec.select.5, %69 ], [ %.144.4, %.preheader.5 ]
  %74 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi81, i64 12
  %75 = load i32, ptr %74, align 4, !tbaa !8
  %.not53.6 = icmp eq i32 %75, 0
  br i1 %.not53.6, label %.preheader.7, label %76

76:                                               ; preds = %.preheader.6
  %77 = sext i32 %75 to i64
  %78 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %77, i32 1
  %79 = load i32, ptr %78, align 4, !tbaa !14
  %80 = icmp slt i32 %79, %24
  %spec.select.6 = select i1 %80, i32 %75, i32 %.144.5
  %.pre82 = sext i32 %spec.select.6 to i64
  br label %.preheader.7

.preheader.7:                                     ; preds = %76, %.preheader.6
  %.pre-phi83 = phi i64 [ %.pre82, %76 ], [ %.pre-phi81, %.preheader.6 ]
  %.144.6 = phi i32 [ %spec.select.6, %76 ], [ %.144.5, %.preheader.6 ]
  %81 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi83, i64 11
  %82 = load i32, ptr %81, align 4, !tbaa !8
  %.not53.7 = icmp eq i32 %82, 0
  br i1 %.not53.7, label %.preheader.8, label %83

83:                                               ; preds = %.preheader.7
  %84 = sext i32 %82 to i64
  %85 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %84, i32 1
  %86 = load i32, ptr %85, align 4, !tbaa !14
  %87 = icmp slt i32 %86, %24
  %spec.select.7 = select i1 %87, i32 %82, i32 %.144.6
  %.pre84 = sext i32 %spec.select.7 to i64
  br label %.preheader.8

.preheader.8:                                     ; preds = %83, %.preheader.7
  %.pre-phi85 = phi i64 [ %.pre84, %83 ], [ %.pre-phi83, %.preheader.7 ]
  %.144.7 = phi i32 [ %spec.select.7, %83 ], [ %.144.6, %.preheader.7 ]
  %88 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi85, i64 10
  %89 = load i32, ptr %88, align 4, !tbaa !8
  %.not53.8 = icmp eq i32 %89, 0
  br i1 %.not53.8, label %.preheader.9, label %90

90:                                               ; preds = %.preheader.8
  %91 = sext i32 %89 to i64
  %92 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %91, i32 1
  %93 = load i32, ptr %92, align 4, !tbaa !14
  %94 = icmp slt i32 %93, %24
  %spec.select.8 = select i1 %94, i32 %89, i32 %.144.7
  %.pre86 = sext i32 %spec.select.8 to i64
  br label %.preheader.9

.preheader.9:                                     ; preds = %90, %.preheader.8
  %.pre-phi87 = phi i64 [ %.pre86, %90 ], [ %.pre-phi85, %.preheader.8 ]
  %.144.8 = phi i32 [ %spec.select.8, %90 ], [ %.144.7, %.preheader.8 ]
  %95 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi87, i64 9
  %96 = load i32, ptr %95, align 4, !tbaa !8
  %.not53.9 = icmp eq i32 %96, 0
  br i1 %.not53.9, label %.preheader.10, label %97

97:                                               ; preds = %.preheader.9
  %98 = sext i32 %96 to i64
  %99 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %98, i32 1
  %100 = load i32, ptr %99, align 4, !tbaa !14
  %101 = icmp slt i32 %100, %24
  %spec.select.9 = select i1 %101, i32 %96, i32 %.144.8
  %.pre88 = sext i32 %spec.select.9 to i64
  br label %.preheader.10

.preheader.10:                                    ; preds = %97, %.preheader.9
  %.pre-phi89 = phi i64 [ %.pre88, %97 ], [ %.pre-phi87, %.preheader.9 ]
  %.144.9 = phi i32 [ %spec.select.9, %97 ], [ %.144.8, %.preheader.9 ]
  %102 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi89, i64 8
  %103 = load i32, ptr %102, align 4, !tbaa !8
  %.not53.10 = icmp eq i32 %103, 0
  br i1 %.not53.10, label %.preheader.11, label %104

104:                                              ; preds = %.preheader.10
  %105 = sext i32 %103 to i64
  %106 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %105, i32 1
  %107 = load i32, ptr %106, align 4, !tbaa !14
  %108 = icmp slt i32 %107, %24
  %spec.select.10 = select i1 %108, i32 %103, i32 %.144.9
  %.pre90 = sext i32 %spec.select.10 to i64
  br label %.preheader.11

.preheader.11:                                    ; preds = %104, %.preheader.10
  %.pre-phi91 = phi i64 [ %.pre90, %104 ], [ %.pre-phi89, %.preheader.10 ]
  %.144.10 = phi i32 [ %spec.select.10, %104 ], [ %.144.9, %.preheader.10 ]
  %109 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi91, i64 7
  %110 = load i32, ptr %109, align 4, !tbaa !8
  %.not53.11 = icmp eq i32 %110, 0
  br i1 %.not53.11, label %.preheader.12, label %111

111:                                              ; preds = %.preheader.11
  %112 = sext i32 %110 to i64
  %113 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %112, i32 1
  %114 = load i32, ptr %113, align 4, !tbaa !14
  %115 = icmp slt i32 %114, %24
  %spec.select.11 = select i1 %115, i32 %110, i32 %.144.10
  %.pre92 = sext i32 %spec.select.11 to i64
  br label %.preheader.12

.preheader.12:                                    ; preds = %111, %.preheader.11
  %.pre-phi93 = phi i64 [ %.pre92, %111 ], [ %.pre-phi91, %.preheader.11 ]
  %.144.11 = phi i32 [ %spec.select.11, %111 ], [ %.144.10, %.preheader.11 ]
  %116 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi93, i64 6
  %117 = load i32, ptr %116, align 4, !tbaa !8
  %.not53.12 = icmp eq i32 %117, 0
  br i1 %.not53.12, label %.preheader.13, label %118

118:                                              ; preds = %.preheader.12
  %119 = sext i32 %117 to i64
  %120 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %119, i32 1
  %121 = load i32, ptr %120, align 4, !tbaa !14
  %122 = icmp slt i32 %121, %24
  %spec.select.12 = select i1 %122, i32 %117, i32 %.144.11
  %.pre94 = sext i32 %spec.select.12 to i64
  br label %.preheader.13

.preheader.13:                                    ; preds = %118, %.preheader.12
  %.pre-phi95 = phi i64 [ %.pre94, %118 ], [ %.pre-phi93, %.preheader.12 ]
  %.144.12 = phi i32 [ %spec.select.12, %118 ], [ %.144.11, %.preheader.12 ]
  %123 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi95, i64 5
  %124 = load i32, ptr %123, align 4, !tbaa !8
  %.not53.13 = icmp eq i32 %124, 0
  br i1 %.not53.13, label %.preheader.14, label %125

125:                                              ; preds = %.preheader.13
  %126 = sext i32 %124 to i64
  %127 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %126, i32 1
  %128 = load i32, ptr %127, align 4, !tbaa !14
  %129 = icmp slt i32 %128, %24
  %spec.select.13 = select i1 %129, i32 %124, i32 %.144.12
  %.pre96 = sext i32 %spec.select.13 to i64
  br label %.preheader.14

.preheader.14:                                    ; preds = %125, %.preheader.13
  %.pre-phi97 = phi i64 [ %.pre96, %125 ], [ %.pre-phi95, %.preheader.13 ]
  %.144.13 = phi i32 [ %spec.select.13, %125 ], [ %.144.12, %.preheader.13 ]
  %130 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi97, i64 4
  %131 = load i32, ptr %130, align 4, !tbaa !8
  %.not53.14 = icmp eq i32 %131, 0
  br i1 %.not53.14, label %.preheader.15, label %132

132:                                              ; preds = %.preheader.14
  %133 = sext i32 %131 to i64
  %134 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %133, i32 1
  %135 = load i32, ptr %134, align 4, !tbaa !14
  %136 = icmp slt i32 %135, %24
  %spec.select.14 = select i1 %136, i32 %131, i32 %.144.13
  %.pre98 = sext i32 %spec.select.14 to i64
  br label %.preheader.15

.preheader.15:                                    ; preds = %132, %.preheader.14
  %.pre-phi99 = phi i64 [ %.pre98, %132 ], [ %.pre-phi97, %.preheader.14 ]
  %.144.14 = phi i32 [ %spec.select.14, %132 ], [ %.144.13, %.preheader.14 ]
  %137 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi99, i64 3
  %138 = load i32, ptr %137, align 4, !tbaa !8
  %.not53.15 = icmp eq i32 %138, 0
  br i1 %.not53.15, label %.preheader.16, label %139

139:                                              ; preds = %.preheader.15
  %140 = sext i32 %138 to i64
  %141 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %140, i32 1
  %142 = load i32, ptr %141, align 4, !tbaa !14
  %143 = icmp slt i32 %142, %24
  %spec.select.15 = select i1 %143, i32 %138, i32 %.144.14
  %.pre100 = sext i32 %spec.select.15 to i64
  br label %.preheader.16

.preheader.16:                                    ; preds = %139, %.preheader.15
  %.pre-phi101 = phi i64 [ %.pre100, %139 ], [ %.pre-phi99, %.preheader.15 ]
  %.144.15 = phi i32 [ %spec.select.15, %139 ], [ %.144.14, %.preheader.15 ]
  %144 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi101, i64 2
  %145 = load i32, ptr %144, align 4, !tbaa !8
  %.not53.16 = icmp eq i32 %145, 0
  br i1 %.not53.16, label %.preheader.17, label %146

146:                                              ; preds = %.preheader.16
  %147 = sext i32 %145 to i64
  %148 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %147, i32 1
  %149 = load i32, ptr %148, align 4, !tbaa !14
  %150 = icmp slt i32 %149, %24
  %spec.select.16 = select i1 %150, i32 %145, i32 %.144.15
  %.pre102 = sext i32 %spec.select.16 to i64
  br label %.preheader.17

.preheader.17:                                    ; preds = %146, %.preheader.16
  %.pre-phi103 = phi i64 [ %.pre102, %146 ], [ %.pre-phi101, %.preheader.16 ]
  %.144.16 = phi i32 [ %spec.select.16, %146 ], [ %.144.15, %.preheader.16 ]
  %151 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi103, i64 1
  %152 = load i32, ptr %151, align 4, !tbaa !8
  %.not53.17 = icmp eq i32 %152, 0
  br i1 %.not53.17, label %.preheader.18, label %153

153:                                              ; preds = %.preheader.17
  %154 = sext i32 %152 to i64
  %155 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %154, i32 1
  %156 = load i32, ptr %155, align 4, !tbaa !14
  %157 = icmp slt i32 %156, %24
  %spec.select.17 = select i1 %157, i32 %152, i32 %.144.16
  %.pre104 = sext i32 %spec.select.17 to i64
  br label %.preheader.18

.preheader.18:                                    ; preds = %153, %.preheader.17
  %.pre-phi105 = phi i64 [ %.pre104, %153 ], [ %.pre-phi103, %.preheader.17 ]
  %.144.17 = phi i32 [ %spec.select.17, %153 ], [ %.144.16, %.preheader.17 ]
  %158 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi105, i64 0
  %159 = load i32, ptr %158, align 4, !tbaa !8
  %.not53.18 = icmp eq i32 %159, 0
  br i1 %.not53.18, label %165, label %160

160:                                              ; preds = %.preheader.18
  %161 = sext i32 %159 to i64
  %162 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %161, i32 1
  %163 = load i32, ptr %162, align 4, !tbaa !14
  %164 = icmp slt i32 %163, %24
  %spec.select.18 = select i1 %164, i32 %159, i32 %.144.17
  %.pre106 = sext i32 %spec.select.18 to i64
  br label %165

165:                                              ; preds = %160, %.preheader.18
  %.pre-phi107 = phi i64 [ %.pre106, %160 ], [ %.pre-phi105, %.preheader.18 ]
  %166 = getelementptr inbounds [200018 x [19 x i32]], ptr @P, i64 0, i64 %.pre-phi107
  %167 = load i32, ptr %166, align 4, !tbaa !8
  %168 = sext i32 %167 to i64
  %169 = getelementptr inbounds [200018 x i32], ptr @ty, i64 0, i64 %168
  %170 = load i32, ptr %169, align 4, !tbaa !8
  %171 = icmp eq i32 %170, 0
  br i1 %171, label %172, label %180

172:                                              ; preds = %165
  %173 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %168
  %174 = load i32, ptr %173, align 8, !tbaa !16
  %175 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %174)
  %176 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %175, i8 noundef signext 32)
  %177 = getelementptr inbounds i8, ptr %173, i64 4
  %178 = load i32, ptr %177, align 4, !tbaa !14
  %179 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %176, i32 noundef %178)
  br label %230, !llvm.loop !13

180:                                              ; preds = %165
  %181 = getelementptr inbounds [200018 x %"class.std::vector"], ptr @pt, i64 0, i64 %168
  %182 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %181) #6
  %183 = trunc i64 %182 to i32
  br label %202

184:                                              ; preds = %228
  %185 = add nsw i32 %.141, 1
  %186 = sext i32 %185 to i64
  %187 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %181, i64 noundef %186) #6
  %188 = load i32, ptr %187, align 4, !tbaa !8
  %189 = sext i32 %188 to i64
  %190 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %189
  %191 = load i32, ptr %190, align 8, !tbaa !16
  %192 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %191)
  %193 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %192, i8 noundef signext 32)
  %194 = add nsw i32 %.1, -1
  %195 = sext i32 %194 to i64
  %196 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %181, i64 noundef %195) #6
  %197 = load i32, ptr %196, align 4, !tbaa !8
  %198 = sext i32 %197 to i64
  %199 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %198, i32 1
  %200 = load i32, ptr %199, align 4, !tbaa !14
  %201 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %193, i32 noundef %200)
  br label %230

202:                                              ; preds = %180, %228
  %.062 = phi i32 [ 18, %180 ], [ %229, %228 ]
  %.03961 = phi i32 [ %183, %180 ], [ %.1, %228 ]
  %.04060 = phi i32 [ -1, %180 ], [ %.141, %228 ]
  %203 = shl nuw i32 1, %.062
  %204 = add nsw i32 %203, %.04060
  %205 = sext i32 %204 to i64
  %206 = call noundef i64 @_ZNKSt6vectorIiSaIiEE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %181) #6
  %207 = icmp ugt i64 %206, %205
  br i1 %207, label %208, label %216

208:                                              ; preds = %202
  %209 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %181, i64 noundef %205) #6
  %210 = load i32, ptr %209, align 4, !tbaa !8
  %211 = sext i32 %210 to i64
  %212 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %211, i32 1
  %213 = load i32, ptr %212, align 4, !tbaa !14
  %214 = load i32, ptr %3, align 4, !tbaa !8
  %215 = icmp slt i32 %213, %214
  %spec.select54 = select i1 %215, i32 %204, i32 %.04060
  br label %216

216:                                              ; preds = %208, %202
  %.141 = phi i32 [ %.04060, %202 ], [ %spec.select54, %208 ]
  %217 = sub nsw i32 %.03961, %203
  %218 = icmp sgt i32 %217, -1
  br i1 %218, label %219, label %228

219:                                              ; preds = %216
  %220 = load i32, ptr %4, align 4, !tbaa !8
  %221 = zext nneg i32 %217 to i64
  %222 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %181, i64 noundef %221) #6
  %223 = load i32, ptr %222, align 4, !tbaa !8
  %224 = sext i32 %223 to i64
  %225 = getelementptr inbounds [200018 x %"struct.std::pair"], ptr @span, i64 0, i64 %224
  %226 = load i32, ptr %225, align 8, !tbaa !16
  %227 = icmp slt i32 %220, %226
  %spec.select55 = select i1 %227, i32 %217, i32 %.03961
  br label %228

228:                                              ; preds = %219, %216
  %.1 = phi i32 [ %.03961, %216 ], [ %spec.select55, %219 ]
  %229 = add nsw i32 %.062, -1
  %.not = icmp eq i32 %.062, 0
  br i1 %.not, label %184, label %202, !llvm.loop !17

230:                                              ; preds = %172, %184, %29
  %.sink = phi ptr [ %179, %172 ], [ %201, %184 ], [ %33, %29 ]
  %231 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_c(ptr noundef nonnull align 8 dereferenceable(8) %.sink, i8 noundef signext 10)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %3) #6
  %232 = load i32, ptr %2, align 4, !tbaa !8
  %233 = add nsw i32 %232, -1
  store i32 %233, ptr %2, align 4, !tbaa !8
  %.not52 = icmp eq i32 %232, 0
  br i1 %.not52, label %._crit_edge66, label %.lr.ph65

._crit_edge66:                                    ; preds = %230, %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #6
  ret i32 0
}

declare noundef zeroext i1 @_ZNSt8ios_base15sync_with_stdioEb(i1 noundef zeroext) local_unnamed_addr #3

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #2 = { 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 #3 = { "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 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 = { 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 #6 = { nounwind }

!llvm.module.flags = !{!0, !1, !2, !3}
!llvm.ident = !{!4}

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}
!8 = !{!9, !9, i64 0}
!9 = !{!"int", !10, i64 0}
!10 = !{!"omnipotent char", !7, i64 0}
!11 = distinct !{!11, !12}
!12 = !{!"llvm.loop.mustprogress"}
!13 = distinct !{!13, !12}
!14 = !{!15, !9, i64 4}
!15 = !{!"_ZTSSt4pairIiiE", !9, i64 0, !9, i64 4}
!16 = !{!15, !9, i64 0}
!17 = distinct !{!17, !12}


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