; LLVM IR from DionysiosB/CodeForces :: 0001-0099 (20C-Dijkstra)

; 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::vector<std::pair<long, long>>, std::allocator<std::vector<std::pair<long, long>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<std::pair<long, long>>, std::allocator<std::vector<std::pair<long, long>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<std::pair<long, long>>, std::allocator<std::vector<std::pair<long, long>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<std::pair<long, long>>, std::allocator<std::vector<std::pair<long, long>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"struct.std::pair" = type { i64, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long, long>, std::pair<long, long>, std::_Identity<std::pair<long, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long, long>, std::pair<long, long>, std::_Identity<std::pair<long, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"struct.std::pair.8" = type <{ %"struct.std::_Rb_tree_const_iterator", i8, [7 x i8] }>
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.12" = type { i8 }
%"class.std::vector.15" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.19" = type { i8 }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i64, align 8
  %3 = alloca i64, align 8
  %4 = alloca %"class.std::vector", align 8
  %5 = alloca %"class.std::allocator", align 1
  %6 = alloca ptr, align 8
  %7 = alloca i32, align 4
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca i64, align 8
  %11 = alloca %"struct.std::pair", align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca i64, align 8
  %14 = alloca i64, align 8
  %15 = alloca %"class.std::set", align 8
  %16 = alloca %"struct.std::pair", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"struct.std::pair.8", align 8
  %19 = alloca %"class.std::vector.10", align 8
  %20 = alloca i64, align 8
  %21 = alloca %"class.std::allocator.12", align 1
  %22 = alloca %"class.std::vector.10", align 8
  %23 = alloca i64, align 8
  %24 = alloca %"class.std::allocator.12", align 1
  %25 = alloca %"class.std::vector.15", align 8
  %26 = alloca i8, align 1
  %27 = alloca %"class.std::allocator.19", align 1
  %28 = alloca %"struct.std::pair", align 8
  %29 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %30 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %31 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %32 = alloca i64, align 8
  %33 = alloca i64, align 8
  %34 = alloca %"struct.std::_Bit_reference", align 8
  %35 = alloca i32, align 4
  %36 = alloca %"struct.std::_Bit_reference", align 8
  %37 = alloca i64, align 8
  %38 = alloca %"struct.std::pair", align 8
  %39 = alloca i64, align 8
  %40 = alloca i64, align 8
  %41 = alloca %"struct.std::_Bit_reference", align 8
  %42 = alloca %"struct.std::pair", align 8
  %43 = alloca %"struct.std::pair.8", align 8
  %44 = alloca %"class.std::stack", align 8
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 8, ptr %2) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %3) #7
  %45 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str, ptr noundef %2, ptr noundef %3)
  call void @llvm.lifetime.start.p0(i64 24, ptr %4) #7
  %46 = load i64, ptr %2, align 8, !tbaa !5
  %47 = add nsw i64 %46, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %5) #7
  call void @_ZNSaISt6vectorISt4pairIllESaIS1_EEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  invoke void @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %47, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %48 unwind label %64

48:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorISt6vectorISt4pairIllESaIS2_EEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  br label %49

49:                                               ; preds = %63, %48
  %50 = load i64, ptr %3, align 8, !tbaa !5
  %51 = add nsw i64 %50, -1
  store i64 %51, ptr %3, align 8, !tbaa !5
  %52 = icmp ne i64 %50, 0
  br i1 %52, label %53, label %81

53:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %8) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %10) #7
  %54 = invoke i32 (ptr, ...) @__isoc99_scanf(ptr noundef @.str.1, ptr noundef %8, ptr noundef %9, ptr noundef %10)
          to label %55 unwind label %68

55:                                               ; preds = %53
  %56 = load i64, ptr %8, align 8, !tbaa !5
  %57 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %56) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %11) #7
  invoke void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %58 unwind label %72

58:                                               ; preds = %55
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %57, ptr noundef nonnull align 8 dereferenceable(16) %11)
          to label %59 unwind label %72

59:                                               ; preds = %58
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  %60 = load i64, ptr %9, align 8, !tbaa !5
  %61 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %60) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %12) #7
  invoke void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 8 dereferenceable(8) %8, ptr noundef nonnull align 8 dereferenceable(8) %10)
          to label %62 unwind label %76

62:                                               ; preds = %59
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %61, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %63 unwind label %76

63:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %49, !llvm.loop !9

64:                                               ; preds = %0
  %65 = landingpad { ptr, i32 }
          cleanup
  %66 = extractvalue { ptr, i32 } %65, 0
  store ptr %66, ptr %6, align 8
  %67 = extractvalue { ptr, i32 } %65, 1
  store i32 %67, ptr %7, align 4
  call void @_ZNSt15__new_allocatorISt6vectorISt4pairIllESaIS2_EEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %5) #7
  br label %306

68:                                               ; preds = %53
  %69 = landingpad { ptr, i32 }
          cleanup
  %70 = extractvalue { ptr, i32 } %69, 0
  store ptr %70, ptr %6, align 8
  %71 = extractvalue { ptr, i32 } %69, 1
  store i32 %71, ptr %7, align 4
  br label %80

72:                                               ; preds = %58, %55
  %73 = landingpad { ptr, i32 }
          cleanup
  %74 = extractvalue { ptr, i32 } %73, 0
  store ptr %74, ptr %6, align 8
  %75 = extractvalue { ptr, i32 } %73, 1
  store i32 %75, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %11) #7
  br label %80

76:                                               ; preds = %62, %59
  %77 = landingpad { ptr, i32 }
          cleanup
  %78 = extractvalue { ptr, i32 } %77, 0
  store ptr %78, ptr %6, align 8
  %79 = extractvalue { ptr, i32 } %77, 1
  store i32 %79, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %12) #7
  br label %80

80:                                               ; preds = %76, %72, %68
  call void @llvm.lifetime.end.p0(i64 8, ptr %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %9) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %8) #7
  br label %305

81:                                               ; preds = %49
  call void @llvm.lifetime.start.p0(i64 8, ptr %13) #7
  store i64 1, ptr %13, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #7
  %82 = load i64, ptr %2, align 8, !tbaa !5
  store i64 %82, ptr %14, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr %15) #7
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #7
  store i32 0, ptr %17, align 4, !tbaa !11
  invoke void @_ZNSt4pairIllEC2IiRlTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 4 dereferenceable(4) %17, ptr noundef nonnull align 8 dereferenceable(8) %13)
          to label %83 unwind label %128

83:                                               ; preds = %81
  %84 = invoke { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %85 unwind label %128

85:                                               ; preds = %83
  %86 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 0
  %87 = extractvalue { ptr, i8 } %84, 0
  store ptr %87, ptr %86, align 8
  %88 = getelementptr inbounds { ptr, i8 }, ptr %18, i32 0, i32 1
  %89 = extractvalue { ptr, i8 } %84, 1
  store i8 %89, ptr %88, align 8
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %19) #7
  %90 = load i64, ptr %2, align 8, !tbaa !5
  %91 = add nsw i64 %90, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  store i64 -1, ptr %20, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %21) #7
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %91, ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 1 dereferenceable(1) %21)
          to label %92 unwind label %132

92:                                               ; preds = %85
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.start.p0(i64 24, ptr %22) #7
  %93 = load i64, ptr %2, align 8, !tbaa !5
  %94 = add nsw i64 %93, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr %23) #7
  store i64 -1, ptr %23, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr %24) #7
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #7
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %94, ptr noundef nonnull align 8 dereferenceable(8) %23, ptr noundef nonnull align 1 dereferenceable(1) %24)
          to label %95 unwind label %136

95:                                               ; preds = %92
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  %96 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef 0) #7
  store i64 0, ptr %96, align 8, !tbaa !5
  %97 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef 1) #7
  store i64 1, ptr %97, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr %25) #7
  %98 = load i64, ptr %2, align 8, !tbaa !5
  %99 = add nsw i64 %98, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr %26) #7
  store i8 0, ptr %26, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #7
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #7
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %25, i64 noundef %99, ptr noundef nonnull align 1 dereferenceable(1) %26, ptr noundef nonnull align 1 dereferenceable(1) %27)
          to label %100 unwind label %140

100:                                              ; preds = %95
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #7
  br label %101

101:                                              ; preds = %240, %238, %100
  %102 = call noundef zeroext i1 @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #7
  %103 = xor i1 %102, true
  br i1 %103, label %104, label %243

104:                                              ; preds = %101
  call void @llvm.lifetime.start.p0(i64 16, ptr %28) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %29) #7
  %105 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #7
  %106 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %29, i32 0, i32 0
  store ptr %105, ptr %106, align 8
  %107 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIllEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %29) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %28, ptr align 8 %107, i64 16, i1 false)
  call void @llvm.lifetime.end.p0(i64 8, ptr %29) #7
  %108 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %15) #7
  %109 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %30, i32 0, i32 0
  store ptr %108, ptr %109, align 8
  %110 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %30, i32 0, i32 0
  %111 = load ptr, ptr %110, align 8
  %112 = invoke ptr @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr %111)
          to label %113 unwind label %144

113:                                              ; preds = %104
  %114 = getelementptr inbounds %"struct.std::_Rb_tree_const_iterator", ptr %31, i32 0, i32 0
  store ptr %112, ptr %114, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %32) #7
  %115 = getelementptr inbounds %"struct.std::pair", ptr %28, i32 0, i32 0
  %116 = load i64, ptr %115, align 8, !tbaa !15
  store i64 %116, ptr %32, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %33) #7
  %117 = getelementptr inbounds %"struct.std::pair", ptr %28, i32 0, i32 1
  %118 = load i64, ptr %117, align 8, !tbaa !17
  store i64 %118, ptr %33, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %34) #7
  %119 = load i64, ptr %33, align 8, !tbaa !5
  %120 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %25, i64 noundef %119)
          to label %121 unwind label %148

121:                                              ; preds = %113
  %122 = getelementptr inbounds { ptr, i64 }, ptr %34, i32 0, i32 0
  %123 = extractvalue { ptr, i64 } %120, 0
  store ptr %123, ptr %122, align 8
  %124 = getelementptr inbounds { ptr, i64 }, ptr %34, i32 0, i32 1
  %125 = extractvalue { ptr, i64 } %120, 1
  store i64 %125, ptr %124, align 8
  %126 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %34) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #7
  br i1 %126, label %127, label %152

127:                                              ; preds = %121
  store i32 4, ptr %35, align 4
  br label %238, !llvm.loop !18

128:                                              ; preds = %83, %81
  %129 = landingpad { ptr, i32 }
          cleanup
  %130 = extractvalue { ptr, i32 } %129, 0
  store ptr %130, ptr %6, align 8
  %131 = extractvalue { ptr, i32 } %129, 1
  store i32 %131, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  br label %304

132:                                              ; preds = %85
  %133 = landingpad { ptr, i32 }
          cleanup
  %134 = extractvalue { ptr, i32 } %133, 0
  store ptr %134, ptr %6, align 8
  %135 = extractvalue { ptr, i32 } %133, 1
  store i32 %135, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  br label %303

136:                                              ; preds = %92
  %137 = landingpad { ptr, i32 }
          cleanup
  %138 = extractvalue { ptr, i32 } %137, 0
  store ptr %138, ptr %6, align 8
  %139 = extractvalue { ptr, i32 } %137, 1
  store i32 %139, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %24) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %24) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %23) #7
  br label %302

140:                                              ; preds = %95
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %6, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %7, align 4
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %27) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #7
  call void @llvm.lifetime.end.p0(i64 1, ptr %26) #7
  br label %301

144:                                              ; preds = %104
  %145 = landingpad { ptr, i32 }
          cleanup
  %146 = extractvalue { ptr, i32 } %145, 0
  store ptr %146, ptr %6, align 8
  %147 = extractvalue { ptr, i32 } %145, 1
  store i32 %147, ptr %7, align 4
  br label %242

148:                                              ; preds = %113
  %149 = landingpad { ptr, i32 }
          cleanup
  %150 = extractvalue { ptr, i32 } %149, 0
  store ptr %150, ptr %6, align 8
  %151 = extractvalue { ptr, i32 } %149, 1
  store i32 %151, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %34) #7
  br label %241

152:                                              ; preds = %121
  call void @llvm.lifetime.start.p0(i64 16, ptr %36) #7
  %153 = load i64, ptr %33, align 8, !tbaa !5
  %154 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %25, i64 noundef %153)
          to label %155 unwind label %168

155:                                              ; preds = %152
  %156 = getelementptr inbounds { ptr, i64 }, ptr %36, i32 0, i32 0
  %157 = extractvalue { ptr, i64 } %154, 0
  store ptr %157, ptr %156, align 8
  %158 = getelementptr inbounds { ptr, i64 }, ptr %36, i32 0, i32 1
  %159 = extractvalue { ptr, i64 } %154, 1
  store i64 %159, ptr %158, align 8
  %160 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %36, i1 noundef zeroext true) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %37) #7
  store i64 0, ptr %37, align 8, !tbaa !5
  br label %161

161:                                              ; preds = %233, %155
  %162 = load i64, ptr %37, align 8, !tbaa !5
  %163 = load i64, ptr %33, align 8, !tbaa !5
  %164 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %163) #7
  %165 = call noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %164) #7
  %166 = icmp ult i64 %162, %165
  br i1 %166, label %172, label %167

167:                                              ; preds = %161
  store i32 6, ptr %35, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  br label %237

168:                                              ; preds = %152
  %169 = landingpad { ptr, i32 }
          cleanup
  %170 = extractvalue { ptr, i32 } %169, 0
  store ptr %170, ptr %6, align 8
  %171 = extractvalue { ptr, i32 } %169, 1
  store i32 %171, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %36) #7
  br label %241

172:                                              ; preds = %161
  call void @llvm.lifetime.start.p0(i64 16, ptr %38) #7
  %173 = load i64, ptr %33, align 8, !tbaa !5
  %174 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %4, i64 noundef %173) #7
  %175 = load i64, ptr %37, align 8, !tbaa !5
  %176 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %174, i64 noundef %175) #7
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %38, ptr align 8 %176, i64 16, i1 false)
  call void @llvm.lifetime.start.p0(i64 8, ptr %39) #7
  %177 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 0
  %178 = load i64, ptr %177, align 8, !tbaa !15
  store i64 %178, ptr %39, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %40) #7
  %179 = getelementptr inbounds %"struct.std::pair", ptr %38, i32 0, i32 1
  %180 = load i64, ptr %179, align 8, !tbaa !17
  store i64 %180, ptr %40, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %41) #7
  %181 = load i64, ptr %39, align 8, !tbaa !5
  %182 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %25, i64 noundef %181)
          to label %183 unwind label %190

183:                                              ; preds = %172
  %184 = getelementptr inbounds { ptr, i64 }, ptr %41, i32 0, i32 0
  %185 = extractvalue { ptr, i64 } %182, 0
  store ptr %185, ptr %184, align 8
  %186 = getelementptr inbounds { ptr, i64 }, ptr %41, i32 0, i32 1
  %187 = extractvalue { ptr, i64 } %182, 1
  store i64 %187, ptr %186, align 8
  %188 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %41) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %41) #7
  br i1 %188, label %189, label %194

189:                                              ; preds = %183
  store i32 8, ptr %35, align 4
  br label %230

190:                                              ; preds = %172
  %191 = landingpad { ptr, i32 }
          cleanup
  %192 = extractvalue { ptr, i32 } %191, 0
  store ptr %192, ptr %6, align 8
  %193 = extractvalue { ptr, i32 } %191, 1
  store i32 %193, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %41) #7
  br label %236

194:                                              ; preds = %183
  %195 = load i64, ptr %39, align 8, !tbaa !5
  %196 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %195) #7
  %197 = load i64, ptr %196, align 8, !tbaa !5
  %198 = icmp slt i64 %197, 0
  br i1 %198, label %207, label %199

199:                                              ; preds = %194
  %200 = load i64, ptr %39, align 8, !tbaa !5
  %201 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %200) #7
  %202 = load i64, ptr %201, align 8, !tbaa !5
  %203 = load i64, ptr %32, align 8, !tbaa !5
  %204 = load i64, ptr %40, align 8, !tbaa !5
  %205 = add nsw i64 %203, %204
  %206 = icmp sgt i64 %202, %205
  br i1 %206, label %207, label %229

207:                                              ; preds = %199, %194
  %208 = load i64, ptr %32, align 8, !tbaa !5
  %209 = load i64, ptr %40, align 8, !tbaa !5
  %210 = add nsw i64 %208, %209
  %211 = load i64, ptr %39, align 8, !tbaa !5
  %212 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %211) #7
  store i64 %210, ptr %212, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr %42) #7
  %213 = load i64, ptr %39, align 8, !tbaa !5
  %214 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %213) #7
  invoke void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %42, ptr noundef nonnull align 8 dereferenceable(8) %214, ptr noundef nonnull align 8 dereferenceable(8) %39)
          to label %215 unwind label %225

215:                                              ; preds = %207
  %216 = invoke { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %15, ptr noundef nonnull align 8 dereferenceable(16) %42)
          to label %217 unwind label %225

217:                                              ; preds = %215
  %218 = getelementptr inbounds { ptr, i8 }, ptr %43, i32 0, i32 0
  %219 = extractvalue { ptr, i8 } %216, 0
  store ptr %219, ptr %218, align 8
  %220 = getelementptr inbounds { ptr, i8 }, ptr %43, i32 0, i32 1
  %221 = extractvalue { ptr, i8 } %216, 1
  store i8 %221, ptr %220, align 8
  call void @llvm.lifetime.end.p0(i64 16, ptr %42) #7
  %222 = load i64, ptr %33, align 8, !tbaa !5
  %223 = load i64, ptr %39, align 8, !tbaa !5
  %224 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %223) #7
  store i64 %222, ptr %224, align 8, !tbaa !5
  br label %229

225:                                              ; preds = %215, %207
  %226 = landingpad { ptr, i32 }
          cleanup
  %227 = extractvalue { ptr, i32 } %226, 0
  store ptr %227, ptr %6, align 8
  %228 = extractvalue { ptr, i32 } %226, 1
  store i32 %228, ptr %7, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %42) #7
  br label %236

229:                                              ; preds = %217, %199
  store i32 0, ptr %35, align 4
  br label %230

230:                                              ; preds = %229, %189
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #7
  %231 = load i32, ptr %35, align 4
  switch i32 %231, label %312 [
    i32 0, label %232
    i32 8, label %233
  ]

232:                                              ; preds = %230
  br label %233

233:                                              ; preds = %232, %230
  %234 = load i64, ptr %37, align 8, !tbaa !5
  %235 = add nsw i64 %234, 1
  store i64 %235, ptr %37, align 8, !tbaa !5
  br label %161, !llvm.loop !19

236:                                              ; preds = %225, %190
  call void @llvm.lifetime.end.p0(i64 8, ptr %40) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %39) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %38) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %37) #7
  br label %241

237:                                              ; preds = %167
  store i32 0, ptr %35, align 4
  br label %238

238:                                              ; preds = %237, %127
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  %239 = load i32, ptr %35, align 4
  switch i32 %239, label %312 [
    i32 0, label %240
    i32 4, label %101
  ]

240:                                              ; preds = %238
  br label %101, !llvm.loop !18

241:                                              ; preds = %236, %168, %148
  call void @llvm.lifetime.end.p0(i64 8, ptr %33) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %32) #7
  br label %242

242:                                              ; preds = %241, %144
  call void @llvm.lifetime.end.p0(i64 16, ptr %28) #7
  br label %300

243:                                              ; preds = %101
  %244 = load i64, ptr %2, align 8, !tbaa !5
  %245 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %19, i64 noundef %244) #7
  %246 = load i64, ptr %245, align 8, !tbaa !5
  %247 = icmp slt i64 %246, 0
  br i1 %247, label %248, label %255

248:                                              ; preds = %243
  %249 = invoke i32 @puts(ptr noundef @.str.2)
          to label %250 unwind label %251

250:                                              ; preds = %248
  br label %298

251:                                              ; preds = %248
  %252 = landingpad { ptr, i32 }
          cleanup
  %253 = extractvalue { ptr, i32 } %252, 0
  store ptr %253, ptr %6, align 8
  %254 = extractvalue { ptr, i32 } %252, 1
  store i32 %254, ptr %7, align 4
  br label %300

255:                                              ; preds = %243
  call void @llvm.lifetime.start.p0(i64 80, ptr %44) #7
  invoke void @_ZNSt5stackIlSt5dequeIlSaIlEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %44)
          to label %256 unwind label %286

256:                                              ; preds = %255
  invoke void @_ZNSt5stackIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %44, ptr noundef nonnull align 8 dereferenceable(8) %2)
          to label %257 unwind label %290

257:                                              ; preds = %256
  br label %258

258:                                              ; preds = %269, %257
  %259 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIlSt5dequeIlSaIlEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %44)
          to label %260 unwind label %290

260:                                              ; preds = %258
  %261 = load i64, ptr %259, align 8, !tbaa !5
  %262 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %261) #7
  invoke void @_ZNSt5stackIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %44, ptr noundef nonnull align 8 dereferenceable(8) %262)
          to label %263 unwind label %290

263:                                              ; preds = %260
  br label %264

264:                                              ; preds = %263
  %265 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIlSt5dequeIlSaIlEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %44)
          to label %266 unwind label %290

266:                                              ; preds = %264
  %267 = load i64, ptr %265, align 8, !tbaa !5
  %268 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIlSt5dequeIlSaIlEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %44)
          to label %269 unwind label %290

269:                                              ; preds = %266
  %270 = load i64, ptr %268, align 8, !tbaa !5
  %271 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %22, i64 noundef %270) #7
  %272 = load i64, ptr %271, align 8, !tbaa !5
  %273 = icmp ne i64 %267, %272
  br i1 %273, label %258, label %274, !llvm.loop !20

274:                                              ; preds = %269
  br label %275

275:                                              ; preds = %285, %274
  %276 = invoke noundef zeroext i1 @_ZNKSt5stackIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %44)
          to label %277 unwind label %290

277:                                              ; preds = %275
  %278 = xor i1 %276, true
  br i1 %278, label %279, label %294

279:                                              ; preds = %277
  %280 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIlSt5dequeIlSaIlEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %44)
          to label %281 unwind label %290

281:                                              ; preds = %279
  %282 = load i64, ptr %280, align 8, !tbaa !5
  %283 = invoke i32 (ptr, ...) @printf(ptr noundef @.str.3, i64 noundef %282)
          to label %284 unwind label %290

284:                                              ; preds = %281
  invoke void @_ZNSt5stackIlSt5dequeIlSaIlEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %44)
          to label %285 unwind label %290

285:                                              ; preds = %284
  br label %275, !llvm.loop !21

286:                                              ; preds = %255
  %287 = landingpad { ptr, i32 }
          cleanup
  %288 = extractvalue { ptr, i32 } %287, 0
  store ptr %288, ptr %6, align 8
  %289 = extractvalue { ptr, i32 } %287, 1
  store i32 %289, ptr %7, align 4
  br label %297

290:                                              ; preds = %294, %284, %281, %279, %275, %266, %264, %260, %258, %256
  %291 = landingpad { ptr, i32 }
          cleanup
  %292 = extractvalue { ptr, i32 } %291, 0
  store ptr %292, ptr %6, align 8
  %293 = extractvalue { ptr, i32 } %291, 1
  store i32 %293, ptr %7, align 4
  call void @_ZNSt5stackIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %44) #7
  br label %297

294:                                              ; preds = %277
  %295 = invoke i32 @puts(ptr noundef @.str.4)
          to label %296 unwind label %290

296:                                              ; preds = %294
  call void @_ZNSt5stackIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %44) #7
  call void @llvm.lifetime.end.p0(i64 80, ptr %44) #7
  br label %298

297:                                              ; preds = %290, %286
  call void @llvm.lifetime.end.p0(i64 80, ptr %44) #7
  br label %300

298:                                              ; preds = %296, %250
  store i32 0, ptr %1, align 4
  store i32 1, ptr %35, align 4
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %25) #7
  call void @llvm.lifetime.end.p0(i64 40, ptr %25) #7
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  call void @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  %299 = load i32, ptr %1, align 4
  ret i32 %299

300:                                              ; preds = %297, %251, %242
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %25) #7
  br label %301

301:                                              ; preds = %300, %140
  call void @llvm.lifetime.end.p0(i64 40, ptr %25) #7
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %22) #7
  br label %302

302:                                              ; preds = %301, %136
  call void @llvm.lifetime.end.p0(i64 24, ptr %22) #7
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %19) #7
  br label %303

303:                                              ; preds = %302, %132
  call void @llvm.lifetime.end.p0(i64 24, ptr %19) #7
  br label %304

304:                                              ; preds = %303, %128
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %15) #7
  call void @llvm.lifetime.end.p0(i64 48, ptr %15) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %13) #7
  br label %305

305:                                              ; preds = %304, %80
  call void @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %4) #7
  br label %306

306:                                              ; preds = %305, %64
  call void @llvm.lifetime.end.p0(i64 24, ptr %4) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %3) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %2) #7
  br label %307

307:                                              ; preds = %306
  %308 = load ptr, ptr %6, align 8
  %309 = load i32, ptr %7, align 4
  %310 = insertvalue { ptr, i32 } poison, ptr %308, 0
  %311 = insertvalue { ptr, i32 } %310, i32 %309, 1
  resume { ptr, i32 } %311

312:                                              ; preds = %238, %230
  unreachable
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt6vectorISt4pairIllESaIS1_EEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIllEC2IiRlTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48), ptr) #4 align 2

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef) #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) #3 align 2

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

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

declare i32 @puts(ptr noundef) #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIlSt5dequeIlSaIlEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #6 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt6vectorISt4pairIllESaIS2_EEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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


; 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::vector<std::pair<long, long>>, std::allocator<std::vector<std::pair<long, long>>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::vector<std::pair<long, long>>, std::allocator<std::vector<std::pair<long, long>>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::vector<std::pair<long, long>>, std::allocator<std::vector<std::pair<long, long>>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::vector<std::pair<long, long>>, std::allocator<std::vector<std::pair<long, long>>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"struct.std::pair" = type { i64, i64 }
%"class.std::set" = type { %"class.std::_Rb_tree" }
%"class.std::_Rb_tree" = type { %"struct.std::_Rb_tree<std::pair<long, long>, std::pair<long, long>, std::_Identity<std::pair<long, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" }
%"struct.std::_Rb_tree<std::pair<long, long>, std::pair<long, long>, std::_Identity<std::pair<long, long>>, std::less<std::pair<long, long>>>::_Rb_tree_impl" = type { [8 x i8], %"struct.std::_Rb_tree_header" }
%"struct.std::_Rb_tree_header" = type { %"struct.std::_Rb_tree_node_base", i64 }
%"struct.std::_Rb_tree_node_base" = type { i32, ptr, ptr, ptr }
%"class.std::vector.10" = type { %"struct.std::_Vector_base.11" }
%"struct.std::_Vector_base.11" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long, std::allocator<long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator.12" = type { i8 }
%"class.std::vector.15" = type { %"struct.std::_Bvector_base" }
%"struct.std::_Bvector_base" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl" = type { %"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" }
%"struct.std::_Bvector_base<std::allocator<bool>>::_Bvector_impl_data" = type { %"struct.std::_Bit_iterator", %"struct.std::_Bit_iterator", ptr }
%"struct.std::_Bit_iterator" = type { %"struct.std::_Bit_iterator_base.base", [4 x i8] }
%"struct.std::_Bit_iterator_base.base" = type <{ ptr, i32 }>
%"class.std::allocator.19" = type { i8 }
%"struct.std::_Rb_tree_const_iterator" = type { ptr }
%"struct.std::_Bit_reference" = type { ptr, i64 }
%"class.std::stack" = type { %"class.std::deque" }
%"class.std::deque" = type { %"class.std::_Deque_base" }
%"class.std::_Deque_base" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl" = type { %"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" }
%"struct.std::_Deque_base<long, std::allocator<long>>::_Deque_impl_data" = type { ptr, i64, %"struct.std::_Deque_iterator", %"struct.std::_Deque_iterator" }
%"struct.std::_Deque_iterator" = type { ptr, ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [11 x i8], align 1
@.str.1 = external hidden unnamed_addr constant [15 x i8], align 1
@.str.2 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.4 = external hidden unnamed_addr constant [1 x i8], align 1

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %1 = alloca i64, align 8
  %2 = alloca i64, align 8
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca i64, align 8
  %6 = alloca i64, align 8
  %7 = alloca i64, align 8
  %8 = alloca %"struct.std::pair", align 8
  %9 = alloca %"struct.std::pair", align 8
  %10 = alloca i64, align 8
  %11 = alloca %"class.std::set", align 8
  %12 = alloca %"struct.std::pair", align 8
  %13 = alloca i32, align 4
  %14 = alloca %"class.std::vector.10", align 8
  %15 = alloca i64, align 8
  %16 = alloca %"class.std::allocator.12", align 1
  %17 = alloca %"class.std::vector.10", align 8
  %18 = alloca i64, align 8
  %19 = alloca %"class.std::allocator.12", align 1
  %20 = alloca %"class.std::vector.15", align 8
  %21 = alloca i8, align 1
  %22 = alloca %"class.std::allocator.19", align 1
  %23 = alloca %"struct.std::_Rb_tree_const_iterator", align 8
  %24 = alloca %"struct.std::_Bit_reference", align 8
  %25 = alloca %"struct.std::_Bit_reference", align 8
  %26 = alloca i64, align 8
  %27 = alloca %"struct.std::_Bit_reference", align 8
  %28 = alloca %"struct.std::pair", align 8
  %29 = alloca %"class.std::stack", align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %1) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %2) #6
  %30 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str, ptr noundef nonnull %1, ptr noundef nonnull %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %3) #6
  %31 = load i64, ptr %1, align 8, !tbaa !5
  %32 = add nsw i64 %31, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %4) #6
  call void @_ZNSaISt6vectorISt4pairIllESaIS1_EEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  invoke void @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %32, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %33 unwind label %45

33:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorISt6vectorISt4pairIllESaIS2_EEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  %34 = load i64, ptr %2, align 8, !tbaa !5
  %35 = add nsw i64 %34, -1
  store i64 %35, ptr %2, align 8, !tbaa !5
  %.not51 = icmp eq i64 %34, 0
  br i1 %.not51, label %._crit_edge, label %.lr.ph

.lr.ph:                                           ; preds = %33, %42
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %5) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #6
  %36 = call i32 (ptr, ...) @__isoc99_scanf(ptr noundef nonnull @.str.1, ptr noundef nonnull %5, ptr noundef nonnull %6, ptr noundef nonnull %7)
  %37 = load i64, ptr %5, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %37) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  call void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %8, ptr noundef nonnull align 8 dereferenceable(8) %6, ptr noundef nonnull align 8 dereferenceable(8) %7)
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %38, ptr noundef nonnull align 8 dereferenceable(16) %8)
          to label %39 unwind label %47

39:                                               ; preds = %.lr.ph
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  %40 = load i64, ptr %6, align 8, !tbaa !5
  %41 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %40) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #6
  call void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %9, ptr noundef nonnull align 8 dereferenceable(8) %5, ptr noundef nonnull align 8 dereferenceable(8) %7)
  invoke void @_ZNSt6vectorISt4pairIllESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %41, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %42 unwind label %49

42:                                               ; preds = %39
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  %43 = load i64, ptr %2, align 8, !tbaa !5
  %44 = add nsw i64 %43, -1
  store i64 %44, ptr %2, align 8, !tbaa !5
  %.not = icmp eq i64 %43, 0
  br i1 %.not, label %._crit_edge, label %.lr.ph, !llvm.loop !9

45:                                               ; preds = %0
  %46 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorISt6vectorISt4pairIllESaIS2_EEED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %4) #6
  br label %175

47:                                               ; preds = %.lr.ph
  %48 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %51

49:                                               ; preds = %39
  %50 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #6
  br label %51

51:                                               ; preds = %49, %47
  %.pn45 = phi { ptr, i32 } [ %50, %49 ], [ %48, %47 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %6) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %5) #6
  br label %174

._crit_edge:                                      ; preds = %42, %33
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #6
  store i64 1, ptr %10, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 48, ptr nonnull %11) #6
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %13) #6
  store i32 0, ptr %13, align 4, !tbaa !11
  call void @_ZNSt4pairIllEC2IiRlTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %12, ptr noundef nonnull align 4 dereferenceable(4) %13, ptr noundef nonnull align 8 dereferenceable(8) %10)
  %52 = invoke { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(16) %12)
          to label %53 unwind label %80

53:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %14) #6
  %54 = load i64, ptr %1, align 8, !tbaa !5
  %55 = add nsw i64 %54, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %15) #6
  store i64 -1, ptr %15, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %16) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %55, ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 1 dereferenceable(1) %16)
          to label %56 unwind label %82

56:                                               ; preds = %53
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %17) #6
  %57 = load i64, ptr %1, align 8, !tbaa !5
  %58 = add nsw i64 %57, 1
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %18) #6
  store i64 -1, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %19) #6
  call void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #6
  invoke void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %58, ptr noundef nonnull align 8 dereferenceable(8) %18, ptr noundef nonnull align 1 dereferenceable(1) %19)
          to label %59 unwind label %84

59:                                               ; preds = %56
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #6
  %60 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef 0) #6
  store i64 0, ptr %60, align 8, !tbaa !5
  %61 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef 1) #6
  store i64 1, ptr %61, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 40, ptr nonnull %20) #6
  %62 = load i64, ptr %1, align 8, !tbaa !5
  %63 = add nsw i64 %62, 1
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %21) #6
  store i8 0, ptr %21, align 1, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %22) #6
  call void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #6
  invoke void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40) %20, i64 noundef %63, ptr noundef nonnull align 1 dereferenceable(1) %21, ptr noundef nonnull align 1 dereferenceable(1) %22)
          to label %64 unwind label %86

64:                                               ; preds = %59
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #6
  %65 = call noundef zeroext i1 @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  br i1 %65, label %._crit_edge57, label %.lr.ph56

.lr.ph56:                                         ; preds = %64
  %66 = getelementptr inbounds i8, ptr %24, i64 8
  %67 = getelementptr inbounds i8, ptr %25, i64 8
  %68 = getelementptr inbounds i8, ptr %27, i64 8
  br label %69

69:                                               ; preds = %.lr.ph56, %.loopexit50
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %23) #6
  %70 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  store ptr %70, ptr %23, align 8
  %71 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNKSt23_Rb_tree_const_iteratorISt4pairIllEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %23) #6
  %.sroa.015.0.copyload = load i64, ptr %71, align 8
  %.sroa.516.0..sroa_idx = getelementptr inbounds i8, ptr %71, i64 8
  %.sroa.516.0.copyload = load i64, ptr %.sroa.516.0..sroa_idx, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %23) #6
  %72 = call ptr @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  %73 = invoke ptr @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr %72)
          to label %74 unwind label %88

74:                                               ; preds = %69
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %24) #6
  %75 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %20, i64 noundef %.sroa.516.0.copyload)
          to label %76 unwind label %90

76:                                               ; preds = %74
  %77 = extractvalue { ptr, i64 } %75, 0
  store ptr %77, ptr %24, align 8
  %78 = extractvalue { ptr, i64 } %75, 1
  store i64 %78, ptr %66, align 8
  %79 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #6
  br i1 %79, label %.loopexit50, label %92, !llvm.loop !15

80:                                               ; preds = %._crit_edge
  %81 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %13) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #6
  br label %173

82:                                               ; preds = %53
  %83 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %16) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %16) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %15) #6
  br label %172

84:                                               ; preds = %56
  %85 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %19) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %19) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %18) #6
  br label %171

86:                                               ; preds = %59
  %87 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %22) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %21) #6
  br label %170

88:                                               ; preds = %69
  %89 = landingpad { ptr, i32 }
          cleanup
  br label %169

90:                                               ; preds = %74
  %91 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %24) #6
  br label %169

92:                                               ; preds = %76
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %25) #6
  %93 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %20, i64 noundef %.sroa.516.0.copyload)
          to label %94 unwind label %100

94:                                               ; preds = %92
  %95 = extractvalue { ptr, i64 } %93, 0
  store ptr %95, ptr %25, align 8
  %96 = extractvalue { ptr, i64 } %93, 1
  store i64 %96, ptr %67, align 8
  %97 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16) %25, i1 noundef zeroext true) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %25) #6
  %98 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.sroa.516.0.copyload) #6
  %99 = call noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %98) #6
  %.not60 = icmp eq i64 %99, 0
  br i1 %.not60, label %.loopexit50, label %.lr.ph54

100:                                              ; preds = %92
  %101 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %25) #6
  br label %169

.lr.ph54:                                         ; preds = %94, %133
  %.03352 = phi i64 [ %134, %133 ], [ 0, %94 ]
  %102 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.sroa.516.0.copyload) #6
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt4pairIllESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %102, i64 noundef %.03352) #6
  %.sroa.02.0.copyload = load i64, ptr %103, align 8
  %.sroa.5.0..sroa_idx = getelementptr inbounds i8, ptr %103, i64 8
  %.sroa.5.0.copyload = load i64, ptr %.sroa.5.0..sroa_idx, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %26) #6
  store i64 %.sroa.02.0.copyload, ptr %26, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %27) #6
  %104 = invoke { ptr, i64 } @_ZNSt6vectorIbSaIbEEixEm(ptr noundef nonnull align 8 dereferenceable(40) %20, i64 noundef %.sroa.02.0.copyload)
          to label %105 unwind label %109

105:                                              ; preds = %.lr.ph54
  %106 = extractvalue { ptr, i64 } %104, 0
  store ptr %106, ptr %27, align 8
  %107 = extractvalue { ptr, i64 } %104, 1
  store i64 %107, ptr %68, align 8
  %108 = call noundef zeroext i1 @_ZNKSt14_Bit_referencecvbEv(ptr noundef nonnull align 8 dereferenceable(16) %27) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #6
  br i1 %108, label %133, label %111

109:                                              ; preds = %.lr.ph54
  %110 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %27) #6
  br label %138

111:                                              ; preds = %105
  %112 = load i64, ptr %26, align 8, !tbaa !5
  %113 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %112) #6
  %114 = load i64, ptr %113, align 8, !tbaa !5
  %115 = icmp slt i64 %114, 0
  br i1 %115, label %._crit_edge61, label %116

._crit_edge61:                                    ; preds = %111
  %.pre = add nsw i64 %.sroa.5.0.copyload, %.sroa.015.0.copyload
  br label %122

116:                                              ; preds = %111
  %117 = load i64, ptr %26, align 8, !tbaa !5
  %118 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %117) #6
  %119 = load i64, ptr %118, align 8, !tbaa !5
  %120 = add nsw i64 %.sroa.5.0.copyload, %.sroa.015.0.copyload
  %121 = icmp sgt i64 %119, %120
  br i1 %121, label %122, label %133

122:                                              ; preds = %._crit_edge61, %116
  %.pre-phi = phi i64 [ %.pre, %._crit_edge61 ], [ %120, %116 ]
  %123 = load i64, ptr %26, align 8, !tbaa !5
  %124 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %123) #6
  store i64 %.pre-phi, ptr %124, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %28) #6
  %125 = load i64, ptr %26, align 8, !tbaa !5
  %126 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %125) #6
  call void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16) %28, ptr noundef nonnull align 8 dereferenceable(8) %126, ptr noundef nonnull align 8 dereferenceable(8) %26)
  %127 = invoke { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48) %11, ptr noundef nonnull align 8 dereferenceable(16) %28)
          to label %128 unwind label %131

128:                                              ; preds = %122
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #6
  %129 = load i64, ptr %26, align 8, !tbaa !5
  %130 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %129) #6
  store i64 %.sroa.516.0.copyload, ptr %130, align 8, !tbaa !5
  br label %133

131:                                              ; preds = %122
  %132 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %28) #6
  br label %138

133:                                              ; preds = %116, %128, %105
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #6
  %134 = add nuw nsw i64 %.03352, 1
  %135 = call noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %.sroa.516.0.copyload) #6
  %136 = call noundef i64 @_ZNKSt6vectorISt4pairIllESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %135) #6
  %137 = icmp ult i64 %134, %136
  br i1 %137, label %.lr.ph54, label %.loopexit50, !llvm.loop !16

138:                                              ; preds = %131, %109
  %.pn36 = phi { ptr, i32 } [ %132, %131 ], [ %110, %109 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %26) #6
  br label %169

.loopexit50:                                      ; preds = %133, %94, %76
  %139 = call noundef zeroext i1 @_ZNKSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5emptyEv(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  br i1 %139, label %._crit_edge57, label %69

._crit_edge57:                                    ; preds = %.loopexit50, %64
  %140 = load i64, ptr %1, align 8, !tbaa !5
  %141 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %14, i64 noundef %140) #6
  %142 = load i64, ptr %141, align 8, !tbaa !5
  %143 = icmp slt i64 %142, 0
  br i1 %143, label %144, label %146

144:                                              ; preds = %._crit_edge57
  %145 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.2)
  br label %168

146:                                              ; preds = %._crit_edge57
  call void @llvm.lifetime.start.p0(i64 80, ptr nonnull %29) #6
  invoke void @_ZNSt5stackIlSt5dequeIlSaIlEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80) %29)
          to label %147 unwind label %163

147:                                              ; preds = %146
  invoke void @_ZNSt5stackIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %29, ptr noundef nonnull align 8 dereferenceable(8) %1)
          to label %.preheader49 unwind label %.loopexit.split-lp

.preheader49:                                     ; preds = %147, %151
  %148 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIlSt5dequeIlSaIlEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %29)
  %149 = load i64, ptr %148, align 8, !tbaa !5
  %150 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %149) #6
  invoke void @_ZNSt5stackIlSt5dequeIlSaIlEEE4pushERKl(ptr noundef nonnull align 8 dereferenceable(80) %29, ptr noundef nonnull align 8 dereferenceable(8) %150)
          to label %151 unwind label %.loopexit

151:                                              ; preds = %.preheader49
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIlSt5dequeIlSaIlEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %29)
  %153 = load i64, ptr %152, align 8, !tbaa !5
  %154 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIlSt5dequeIlSaIlEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %29)
  %155 = load i64, ptr %154, align 8, !tbaa !5
  %156 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt6vectorIlSaIlEEixEm(ptr noundef nonnull align 8 dereferenceable(24) %17, i64 noundef %155) #6
  %157 = load i64, ptr %156, align 8, !tbaa !5
  %.not35 = icmp eq i64 %153, %157
  br i1 %.not35, label %.preheader, label %.preheader49, !llvm.loop !17

.preheader:                                       ; preds = %151
  %158 = call noundef zeroext i1 @_ZNKSt5stackIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %29)
  br i1 %158, label %._crit_edge59, label %.lr.ph58

.lr.ph58:                                         ; preds = %.preheader, %.lr.ph58
  %159 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZNSt5stackIlSt5dequeIlSaIlEEE3topEv(ptr noundef nonnull align 8 dereferenceable(80) %29)
  %160 = load i64, ptr %159, align 8, !tbaa !5
  %161 = call i32 (ptr, ...) @printf(ptr noundef nonnull dereferenceable(1) @.str.3, i64 noundef %160)
  call void @_ZNSt5stackIlSt5dequeIlSaIlEEE3popEv(ptr noundef nonnull align 8 dereferenceable(80) %29)
  %162 = call noundef zeroext i1 @_ZNKSt5stackIlSt5dequeIlSaIlEEE5emptyEv(ptr noundef nonnull align 8 dereferenceable(80) %29)
  br i1 %162, label %._crit_edge59, label %.lr.ph58, !llvm.loop !18

163:                                              ; preds = %146
  %164 = landingpad { ptr, i32 }
          cleanup
  br label %167

.loopexit:                                        ; preds = %.preheader49
  %lpad.loopexit = landingpad { ptr, i32 }
          cleanup
  br label %165

.loopexit.split-lp:                               ; preds = %147
  %lpad.loopexit.split-lp = landingpad { ptr, i32 }
          cleanup
  br label %165

165:                                              ; preds = %.loopexit.split-lp, %.loopexit
  %lpad.phi = phi { ptr, i32 } [ %lpad.loopexit, %.loopexit ], [ %lpad.loopexit.split-lp, %.loopexit.split-lp ]
  call void @_ZNSt5stackIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %29) #6
  br label %167

._crit_edge59:                                    ; preds = %.lr.ph58, %.preheader
  %166 = call i32 @puts(ptr noundef nonnull dereferenceable(1) @.str.4)
  call void @_ZNSt5stackIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80) %29) #6
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %29) #6
  br label %168

167:                                              ; preds = %165, %163
  %.pn = phi { ptr, i32 } [ %lpad.phi, %165 ], [ %164, %163 ]
  call void @llvm.lifetime.end.p0(i64 80, ptr nonnull %29) #6
  br label %169

168:                                              ; preds = %._crit_edge59, %144
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %20) #6
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %20) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #6
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  call void @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  ret i32 0

169:                                              ; preds = %88, %138, %100, %90, %167
  %.pn36.pn.pn.pn = phi { ptr, i32 } [ %.pn, %167 ], [ %89, %88 ], [ %.pn36, %138 ], [ %101, %100 ], [ %91, %90 ]
  call void @_ZNSt13_Bvector_baseISaIbEED2Ev(ptr noundef nonnull align 8 dereferenceable(40) %20) #6
  br label %170

170:                                              ; preds = %169, %86
  %.pn36.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn36.pn.pn.pn, %169 ], [ %87, %86 ]
  call void @llvm.lifetime.end.p0(i64 40, ptr nonnull %20) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %17) #6
  br label %171

171:                                              ; preds = %170, %84
  %.pn36.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn36.pn.pn.pn.pn, %170 ], [ %85, %84 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %17) #6
  call void @_ZNSt6vectorIlSaIlEED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %14) #6
  br label %172

172:                                              ; preds = %171, %82
  %.pn36.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn36.pn.pn.pn.pn.pn, %171 ], [ %83, %82 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %14) #6
  br label %173

173:                                              ; preds = %172, %80
  %.pn36.pn.pn.pn.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn36.pn.pn.pn.pn.pn.pn, %172 ], [ %81, %80 ]
  call void @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(48) %11) #6
  call void @llvm.lifetime.end.p0(i64 48, ptr nonnull %11) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #6
  br label %174

174:                                              ; preds = %173, %51
  %.pn45.pn = phi { ptr, i32 } [ %.pn45, %51 ], [ %.pn36.pn.pn.pn.pn.pn.pn.pn, %173 ]
  call void @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #6
  br label %175

175:                                              ; preds = %174, %45
  %.pn45.pn.pn = phi { ptr, i32 } [ %.pn45.pn, %174 ], [ %46, %45 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %3) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %2) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %1) #6
  resume { ptr, i32 } %.pn45.pn.pn
}

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaISt6vectorISt4pairIllESaIS1_EEEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEC2EmRKS4_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

declare i32 @__gxx_personality_v0(...)

; 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 nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(24) ptr @_ZNSt6vectorIS_ISt4pairIllESaIS1_EESaIS3_EEixEm(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef) local_unnamed_addr #3 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIllEC2IRlS2_TnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local { ptr, i8 } @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE6insertEOS1_(ptr noundef nonnull align 8 dereferenceable(48), ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt4pairIllEC2IiRlTnNSt9enable_ifIXaaclsr5_PCCPE22_MoveConstructiblePairIT_T0_EEclsr5_PCCPE30_ImplicitlyMoveConvertiblePairIS4_S5_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 8 dereferenceable(16), ptr noundef nonnull align 4 dereferenceable(4), ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIlEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIlSaIlEEC2EmRKlRKS0_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSaIbEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorIbSaIbEEC2EmRKbRKS0_(ptr noundef nonnull align 8 dereferenceable(40), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1), ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #4 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIbED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local ptr @_ZNSt3setISt4pairIllESt4lessIS1_ESaIS1_EE5eraseB5cxx11ESt23_Rb_tree_const_iteratorIS1_E(ptr noundef nonnull align 8 dereferenceable(48), ptr) local_unnamed_addr #4 align 2

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt14_Bit_referenceaSEb(ptr noundef nonnull align 8 dereferenceable(16), i1 noundef zeroext) local_unnamed_addr #3 align 2

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

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

; Function Attrs: nofree nounwind
declare noundef i32 @puts(ptr nocapture noundef readonly) local_unnamed_addr #2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt5stackIlSt5dequeIlSaIlEEEC2IS2_vEEv(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #4 align 2

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

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

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

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare dso_local void @_ZNSt5stackIlSt5dequeIlSaIlEEED2Ev(ptr noundef nonnull align 8 dereferenceable(80)) unnamed_addr #5 align 2

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorISt6vectorISt4pairIllESaIS2_EEED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIlED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #3 align 2

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


; Effective O3 passes: EarlyCSEPass,GVNPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LICMPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,ReassociatePass,SROAPass,SimplifyCFGPass