; LLVM IR from kazunetakahashi/atcoder :: 2020/0118_keyence2020 (D)

; 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::basic_ostream" = type { ptr, %"class.std::basic_ios" }
%"class.std::basic_ios" = type { %"class.std::ios_base", ptr, i8, i8, ptr, ptr, ptr, ptr }
%"class.std::ios_base" = type { ptr, i64, i64, i32, i32, i32, ptr, %"struct.std::ios_base::_Words", [8 x %"struct.std::ios_base::_Words"], i32, ptr, %"class.std::locale" }
%"struct.std::ios_base::_Words" = type { ptr, i64 }
%"class.std::locale" = type { ptr }
%"class.std::basic_istream" = type { ptr, i64, %"class.std::basic_ios" }
%class.anon = type { i8 }
%class.anon.12 = type { i8 }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<Card, std::allocator<Card>>::_Vector_impl" }
%"struct.std::_Vector_base<Card, std::allocator<Card>>::_Vector_impl" = type { %"struct.std::_Vector_base<Card, std::allocator<Card>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Card, std::allocator<Card>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::allocator" = type { i8 }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::tuple<int, int>, std::allocator<std::tuple<int, int>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::tuple" = type { %"struct.std::_Tuple_impl" }
%"struct.std::_Tuple_impl" = type { %"struct.std::_Tuple_impl.5", %"struct.std::_Head_base.6" }
%"struct.std::_Tuple_impl.5" = type { %"struct.std::_Head_base" }
%"struct.std::_Head_base" = type { i32 }
%"struct.std::_Head_base.6" = type { i32 }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.SegTree = type { i32, %"class.std::vector.7", i64, ptr, ptr }
%"class.std::vector.7" = type { %"struct.std::_Vector_base.8" }
%"struct.std::_Vector_base.8" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl" = type { %"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" }
%"struct.std::_Vector_base<long long, std::allocator<long long>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%struct.Card = type { i32, i32 }

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [85 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@func2 = external hidden global %class.anon, align 1
@_update2 = external hidden global %class.anon.12, align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #0

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca i32, align 4
  %3 = alloca %"class.std::vector", align 8
  %4 = alloca %"class.std::allocator", align 1
  %5 = alloca ptr, align 8
  %6 = alloca i32, align 4
  %7 = alloca i32, align 4
  %8 = alloca i32, align 4
  %9 = alloca i32, align 4
  %10 = alloca i32, align 4
  %11 = alloca i32, align 4
  %12 = alloca i32, align 4
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.std::vector.0", align 8
  %16 = alloca %"class.std::vector.0", align 8
  %17 = alloca i32, align 4
  %18 = alloca %"class.std::tuple", align 4
  %19 = alloca %"class.std::tuple", align 4
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %23 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %24 = alloca %"class.std::vector.0", align 8
  %25 = alloca i32, align 4
  %26 = alloca i32, align 4
  %27 = alloca i8, align 1
  %28 = alloca i32, align 4
  %29 = alloca i32, align 4
  %30 = alloca %class.SegTree, align 8
  %31 = alloca i32, align 4
  %32 = alloca i32, align 4
  %33 = alloca i32, align 4
  store i32 0, ptr %1, align 4
  call void @llvm.lifetime.start.p0(i64 4, ptr %2) #8
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %2)
  call void @llvm.lifetime.start.p0(i64 24, ptr %3) #8
  %35 = load i32, ptr %2, align 4, !tbaa !5
  %36 = sext i32 %35 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr %4) #8
  call void @_ZNSaI4CardEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  invoke void @_ZNSt6vectorI4CardSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %36, ptr noundef nonnull align 1 dereferenceable(1) %4)
          to label %37 unwind label %43

37:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI4CardED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %7) #8
  store i32 0, ptr %7, align 4, !tbaa !5
  br label %38

38:                                               ; preds = %54, %37
  %39 = load i32, ptr %7, align 4, !tbaa !5
  %40 = load i32, ptr %2, align 4, !tbaa !5
  %41 = icmp slt i32 %39, %40
  br i1 %41, label %47, label %42

42:                                               ; preds = %38
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %61

43:                                               ; preds = %0
  %44 = landingpad { ptr, i32 }
          cleanup
  %45 = extractvalue { ptr, i32 } %44, 0
  store ptr %45, ptr %5, align 8
  %46 = extractvalue { ptr, i32 } %44, 1
  store i32 %46, ptr %6, align 4
  call void @_ZNSt15__new_allocatorI4CardED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %4) #8
  call void @llvm.lifetime.end.p0(i64 1, ptr %4) #8
  br label %392

47:                                               ; preds = %38
  %48 = load i32, ptr %7, align 4, !tbaa !5
  %49 = sext i32 %48 to i64
  %50 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %49) #8
  %51 = getelementptr inbounds %struct.Card, ptr %50, i32 0, i32 0
  %52 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %51)
          to label %53 unwind label %57

53:                                               ; preds = %47
  br label %54

54:                                               ; preds = %53
  %55 = load i32, ptr %7, align 4, !tbaa !5
  %56 = add nsw i32 %55, 1
  store i32 %56, ptr %7, align 4, !tbaa !5
  br label %38, !llvm.loop !9

57:                                               ; preds = %47
  %58 = landingpad { ptr, i32 }
          cleanup
  %59 = extractvalue { ptr, i32 } %58, 0
  store ptr %59, ptr %5, align 8
  %60 = extractvalue { ptr, i32 } %58, 1
  store i32 %60, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %7) #8
  br label %391

61:                                               ; preds = %42
  call void @llvm.lifetime.start.p0(i64 4, ptr %8) #8
  store i32 0, ptr %8, align 4, !tbaa !5
  br label %62

62:                                               ; preds = %74, %61
  %63 = load i32, ptr %8, align 4, !tbaa !5
  %64 = load i32, ptr %2, align 4, !tbaa !5
  %65 = icmp slt i32 %63, %64
  br i1 %65, label %67, label %66

66:                                               ; preds = %62
  call void @llvm.lifetime.end.p0(i64 4, ptr %8) #8
  br label %81

67:                                               ; preds = %62
  %68 = load i32, ptr %8, align 4, !tbaa !5
  %69 = sext i32 %68 to i64
  %70 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %69) #8
  %71 = getelementptr inbounds %struct.Card, ptr %70, i32 0, i32 1
  %72 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %71)
          to label %73 unwind label %77

73:                                               ; preds = %67
  br label %74

74:                                               ; preds = %73
  %75 = load i32, ptr %8, align 4, !tbaa !5
  %76 = add nsw i32 %75, 1
  store i32 %76, ptr %8, align 4, !tbaa !5
  br label %62, !llvm.loop !11

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

81:                                               ; preds = %66
  call void @llvm.lifetime.start.p0(i64 4, ptr %9) #8
  store i32 1, ptr %9, align 4, !tbaa !5
  br label %82

82:                                               ; preds = %96, %81
  %83 = load i32, ptr %9, align 4, !tbaa !5
  %84 = load i32, ptr %2, align 4, !tbaa !5
  %85 = icmp slt i32 %83, %84
  br i1 %85, label %87, label %86

86:                                               ; preds = %82
  call void @llvm.lifetime.end.p0(i64 4, ptr %9) #8
  br label %99

87:                                               ; preds = %82
  %88 = load i32, ptr %9, align 4, !tbaa !5
  %89 = sext i32 %88 to i64
  %90 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %89) #8
  %91 = getelementptr inbounds %struct.Card, ptr %90, i32 0, i32 0
  %92 = load i32, ptr %9, align 4, !tbaa !5
  %93 = sext i32 %92 to i64
  %94 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %93) #8
  %95 = getelementptr inbounds %struct.Card, ptr %94, i32 0, i32 1
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %91, ptr noundef nonnull align 4 dereferenceable(4) %95) #8
  br label %96

96:                                               ; preds = %87
  %97 = load i32, ptr %9, align 4, !tbaa !5
  %98 = add nsw i32 %97, 2
  store i32 %98, ptr %9, align 4, !tbaa !5
  br label %82, !llvm.loop !12

99:                                               ; preds = %86
  %100 = load i32, ptr %2, align 4, !tbaa !5
  %101 = icmp eq i32 %100, 1
  br i1 %101, label %102, label %111

102:                                              ; preds = %99
  %103 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
          to label %104 unwind label %107

104:                                              ; preds = %102
  %105 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %103, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %106 unwind label %107

106:                                              ; preds = %104
  store i32 0, ptr %1, align 4
  store i32 1, ptr %10, align 4
  br label %386

107:                                              ; preds = %104, %102
  %108 = landingpad { ptr, i32 }
          cleanup
  %109 = extractvalue { ptr, i32 } %108, 0
  store ptr %109, ptr %5, align 8
  %110 = extractvalue { ptr, i32 } %108, 1
  store i32 %110, ptr %6, align 4
  br label %391

111:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 4, ptr %11) #8
  store i32 100000, ptr %11, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %12) #8
  store i32 0, ptr %12, align 4, !tbaa !5
  br label %112

112:                                              ; preds = %364, %111
  %113 = load i32, ptr %12, align 4, !tbaa !5
  %114 = load i32, ptr %2, align 4, !tbaa !5
  %115 = shl i32 1, %114
  %116 = icmp slt i32 %113, %115
  br i1 %116, label %118, label %117

117:                                              ; preds = %112
  store i32 11, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %367

118:                                              ; preds = %112
  call void @llvm.lifetime.start.p0(i64 4, ptr %13) #8
  store i32 0, ptr %13, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %14) #8
  store i32 0, ptr %14, align 4, !tbaa !5
  br label %119

119:                                              ; preds = %131, %118
  %120 = load i32, ptr %14, align 4, !tbaa !5
  %121 = load i32, ptr %2, align 4, !tbaa !5
  %122 = icmp slt i32 %120, %121
  br i1 %122, label %124, label %123

123:                                              ; preds = %119
  store i32 14, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %14) #8
  br label %134

124:                                              ; preds = %119
  %125 = load i32, ptr %12, align 4, !tbaa !5
  %126 = load i32, ptr %14, align 4, !tbaa !5
  %127 = ashr i32 %125, %126
  %128 = and i32 %127, 1
  %129 = load i32, ptr %13, align 4, !tbaa !5
  %130 = add nsw i32 %129, %128
  store i32 %130, ptr %13, align 4, !tbaa !5
  br label %131

131:                                              ; preds = %124
  %132 = load i32, ptr %14, align 4, !tbaa !5
  %133 = add nsw i32 %132, 1
  store i32 %133, ptr %14, align 4, !tbaa !5
  br label %119, !llvm.loop !13

134:                                              ; preds = %123
  %135 = load i32, ptr %13, align 4, !tbaa !5
  %136 = load i32, ptr %2, align 4, !tbaa !5
  %137 = load i32, ptr %2, align 4, !tbaa !5
  %138 = sdiv i32 %137, 2
  %139 = sub nsw i32 %136, %138
  %140 = icmp eq i32 %135, %139
  br i1 %140, label %141, label %360

141:                                              ; preds = %134
  call void @llvm.lifetime.start.p0(i64 24, ptr %15) #8
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  call void @llvm.lifetime.start.p0(i64 24, ptr %16) #8
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %17) #8
  store i32 0, ptr %17, align 4, !tbaa !5
  br label %142

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

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

147:                                              ; preds = %142
  %148 = load i32, ptr %12, align 4, !tbaa !5
  %149 = load i32, ptr %17, align 4, !tbaa !5
  %150 = ashr i32 %148, %149
  %151 = and i32 %150, 1
  %152 = icmp ne i32 %151, 0
  br i1 %152, label %153, label %163

153:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #8
  %154 = load i32, ptr %17, align 4, !tbaa !5
  %155 = sext i32 %154 to i64
  %156 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %155) #8
  %157 = getelementptr inbounds %struct.Card, ptr %156, i32 0, i32 0
  call void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %18, ptr noundef nonnull align 4 dereferenceable(4) %157, ptr noundef nonnull align 4 dereferenceable(4) %17) #8
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %15, ptr noundef nonnull align 4 dereferenceable(8) %18)
          to label %158 unwind label %159

158:                                              ; preds = %153
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %173

159:                                              ; preds = %153
  %160 = landingpad { ptr, i32 }
          cleanup
  %161 = extractvalue { ptr, i32 } %160, 0
  store ptr %161, ptr %5, align 8
  %162 = extractvalue { ptr, i32 } %160, 1
  store i32 %162, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #8
  br label %177

163:                                              ; preds = %147
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #8
  %164 = load i32, ptr %17, align 4, !tbaa !5
  %165 = sext i32 %164 to i64
  %166 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %3, i64 noundef %165) #8
  %167 = getelementptr inbounds %struct.Card, ptr %166, i32 0, i32 1
  call void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %19, ptr noundef nonnull align 4 dereferenceable(4) %167, ptr noundef nonnull align 4 dereferenceable(4) %17) #8
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %16, ptr noundef nonnull align 4 dereferenceable(8) %19)
          to label %168 unwind label %169

168:                                              ; preds = %163
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %173

169:                                              ; preds = %163
  %170 = landingpad { ptr, i32 }
          cleanup
  %171 = extractvalue { ptr, i32 } %170, 0
  store ptr %171, ptr %5, align 8
  %172 = extractvalue { ptr, i32 } %170, 1
  store i32 %172, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #8
  br label %177

173:                                              ; preds = %168, %158
  br label %174

174:                                              ; preds = %173
  %175 = load i32, ptr %17, align 4, !tbaa !5
  %176 = add nsw i32 %175, 1
  store i32 %176, ptr %17, align 4, !tbaa !5
  br label %142, !llvm.loop !14

177:                                              ; preds = %169, %159
  call void @llvm.lifetime.end.p0(i64 4, ptr %17) #8
  br label %359

178:                                              ; preds = %146
  %179 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  %180 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %179, ptr %180, align 8
  %181 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  %182 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %181, ptr %182, align 8
  %183 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  %184 = load ptr, ptr %183, align 8
  %185 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  %186 = load ptr, ptr %185, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %184, ptr %186)
          to label %187 unwind label %220

187:                                              ; preds = %178
  %188 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #8
  %189 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  store ptr %188, ptr %189, align 8
  %190 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #8
  %191 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  store ptr %190, ptr %191, align 8
  %192 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %22, i32 0, i32 0
  %193 = load ptr, ptr %192, align 8
  %194 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %23, i32 0, i32 0
  %195 = load ptr, ptr %194, align 8
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %193, ptr %195)
          to label %196 unwind label %220

196:                                              ; preds = %187
  call void @llvm.lifetime.start.p0(i64 24, ptr %24) #8
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.start.p0(i64 4, ptr %25) #8
  store i32 0, ptr %25, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %26) #8
  store i32 0, ptr %26, align 4, !tbaa !5
  br label %197

197:                                              ; preds = %228, %196
  %198 = load i32, ptr %25, align 4, !tbaa !5
  %199 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  %200 = trunc i64 %199 to i32
  %201 = icmp slt i32 %198, %200
  br i1 %201, label %202, label %229

202:                                              ; preds = %197
  %203 = load i32, ptr %25, align 4, !tbaa !5
  %204 = sext i32 %203 to i64
  %205 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %15, i64 noundef %204) #8
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 4 dereferenceable(8) %205)
          to label %206 unwind label %224

206:                                              ; preds = %202
  %207 = load i32, ptr %25, align 4, !tbaa !5
  %208 = add nsw i32 %207, 1
  store i32 %208, ptr %25, align 4, !tbaa !5
  %209 = load i32, ptr %26, align 4, !tbaa !5
  %210 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %16) #8
  %211 = trunc i64 %210 to i32
  %212 = icmp slt i32 %209, %211
  br i1 %212, label %213, label %228

213:                                              ; preds = %206
  %214 = load i32, ptr %26, align 4, !tbaa !5
  %215 = sext i32 %214 to i64
  %216 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %16, i64 noundef %215) #8
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %24, ptr noundef nonnull align 4 dereferenceable(8) %216)
          to label %217 unwind label %224

217:                                              ; preds = %213
  %218 = load i32, ptr %26, align 4, !tbaa !5
  %219 = add nsw i32 %218, 1
  store i32 %219, ptr %26, align 4, !tbaa !5
  br label %228

220:                                              ; preds = %187, %178
  %221 = landingpad { ptr, i32 }
          cleanup
  %222 = extractvalue { ptr, i32 } %221, 0
  store ptr %222, ptr %5, align 8
  %223 = extractvalue { ptr, i32 } %221, 1
  store i32 %223, ptr %6, align 4
  br label %359

224:                                              ; preds = %213, %202
  %225 = landingpad { ptr, i32 }
          cleanup
  %226 = extractvalue { ptr, i32 } %225, 0
  store ptr %226, ptr %5, align 8
  %227 = extractvalue { ptr, i32 } %225, 1
  store i32 %227, ptr %6, align 4
  br label %358

228:                                              ; preds = %217, %206
  br label %197, !llvm.loop !15

229:                                              ; preds = %197
  %230 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  %231 = trunc i64 %230 to i32
  %232 = load i32, ptr %2, align 4, !tbaa !5
  %233 = icmp eq i32 %231, %232
  br i1 %233, label %234, label %235

234:                                              ; preds = %229
  br label %237

235:                                              ; preds = %229
  call void @__assert_fail(ptr noundef @.str.2, ptr noundef @.str.3, i32 noundef 339, ptr noundef @__PRETTY_FUNCTION__.main) #9
  unreachable

236:                                              ; No predecessors!
  br label %237

237:                                              ; preds = %236, %234
  call void @llvm.lifetime.start.p0(i64 1, ptr %27) #8
  store i8 1, ptr %27, align 1, !tbaa !16
  call void @llvm.lifetime.start.p0(i64 4, ptr %28) #8
  store i32 0, ptr %28, align 4, !tbaa !5
  br label %238

238:                                              ; preds = %259, %237
  %239 = load i32, ptr %28, align 4, !tbaa !5
  %240 = load i32, ptr %2, align 4, !tbaa !5
  %241 = sub nsw i32 %240, 1
  %242 = icmp slt i32 %239, %241
  br i1 %242, label %244, label %243

243:                                              ; preds = %238
  store i32 22, ptr %10, align 4
  br label %262

244:                                              ; preds = %238
  %245 = load i32, ptr %28, align 4, !tbaa !5
  %246 = sext i32 %245 to i64
  %247 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %246) #8
  %248 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %247) #8
  %249 = load i32, ptr %248, align 4, !tbaa !5
  %250 = load i32, ptr %28, align 4, !tbaa !5
  %251 = add nsw i32 %250, 1
  %252 = sext i32 %251 to i64
  %253 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %252) #8
  %254 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %253) #8
  %255 = load i32, ptr %254, align 4, !tbaa !5
  %256 = icmp sgt i32 %249, %255
  br i1 %256, label %257, label %258

257:                                              ; preds = %244
  store i8 0, ptr %27, align 1, !tbaa !16
  store i32 22, ptr %10, align 4
  br label %262

258:                                              ; preds = %244
  br label %259

259:                                              ; preds = %258
  %260 = load i32, ptr %28, align 4, !tbaa !5
  %261 = add nsw i32 %260, 1
  store i32 %261, ptr %28, align 4, !tbaa !5
  br label %238, !llvm.loop !18

262:                                              ; preds = %257, %243
  call void @llvm.lifetime.end.p0(i64 4, ptr %28) #8
  br label %263

263:                                              ; preds = %262
  %264 = load i8, ptr %27, align 1, !tbaa !16, !range !19, !noundef !20
  %265 = trunc i8 %264 to i1
  br i1 %265, label %267, label %266

266:                                              ; preds = %263
  store i32 13, ptr %10, align 4
  br label %348

267:                                              ; preds = %263
  call void @llvm.lifetime.start.p0(i64 4, ptr %29) #8
  store i32 0, ptr %29, align 4, !tbaa !5
  br label %268

268:                                              ; preds = %301, %267
  %269 = load i32, ptr %29, align 4, !tbaa !5
  %270 = load i32, ptr %2, align 4, !tbaa !5
  %271 = icmp slt i32 %269, %270
  br i1 %271, label %273, label %272

272:                                              ; preds = %268
  store i32 25, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %308

273:                                              ; preds = %268
  %274 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef @.str.4)
          to label %275 unwind label %304

275:                                              ; preds = %273
  %276 = load i32, ptr %29, align 4, !tbaa !5
  %277 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %274, i32 noundef %276)
          to label %278 unwind label %304

278:                                              ; preds = %275
  %279 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %277, ptr noundef @.str.5)
          to label %280 unwind label %304

280:                                              ; preds = %278
  %281 = load i32, ptr %29, align 4, !tbaa !5
  %282 = sext i32 %281 to i64
  %283 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %282) #8
  %284 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %283) #8
  %285 = load i32, ptr %284, align 4, !tbaa !5
  %286 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %279, i32 noundef %285)
          to label %287 unwind label %304

287:                                              ; preds = %280
  %288 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %286, ptr noundef @.str.6)
          to label %289 unwind label %304

289:                                              ; preds = %287
  %290 = load i32, ptr %29, align 4, !tbaa !5
  %291 = sext i32 %290 to i64
  %292 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %291) #8
  %293 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %292) #8
  %294 = load i32, ptr %293, align 4, !tbaa !5
  %295 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %288, i32 noundef %294)
          to label %296 unwind label %304

296:                                              ; preds = %289
  %297 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %295, ptr noundef @.str.7)
          to label %298 unwind label %304

298:                                              ; preds = %296
  %299 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %297, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %300 unwind label %304

300:                                              ; preds = %298
  br label %301

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

304:                                              ; preds = %298, %296, %289, %287, %280, %278, %275, %273
  %305 = landingpad { ptr, i32 }
          cleanup
  %306 = extractvalue { ptr, i32 } %305, 0
  store ptr %306, ptr %5, align 8
  %307 = extractvalue { ptr, i32 } %305, 1
  store i32 %307, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %29) #8
  br label %357

308:                                              ; preds = %272
  call void @llvm.lifetime.start.p0(i64 56, ptr %30) #8
  %309 = load i32, ptr %2, align 4, !tbaa !5
  %310 = call noundef ptr @"_ZNK3$_0cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1) @func2) #8
  %311 = call noundef ptr @"_ZNK3$_1cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1) @_update2) #8
  invoke void @_ZN7SegTreeIxEC2EixPFxxxES2_(ptr noundef nonnull align 8 dereferenceable(56) %30, i32 noundef %309, i64 noundef 0, ptr noundef %310, ptr noundef %311)
          to label %312 unwind label %318

312:                                              ; preds = %308
  call void @llvm.lifetime.start.p0(i64 4, ptr %31) #8
  store i32 0, ptr %31, align 4, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 4, ptr %32) #8
  store i32 0, ptr %32, align 4, !tbaa !5
  br label %313

313:                                              ; preds = %338, %312
  %314 = load i32, ptr %32, align 4, !tbaa !5
  %315 = load i32, ptr %2, align 4, !tbaa !5
  %316 = icmp slt i32 %314, %315
  br i1 %316, label %322, label %317

317:                                              ; preds = %313
  store i32 28, ptr %10, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %345

318:                                              ; preds = %308
  %319 = landingpad { ptr, i32 }
          cleanup
  %320 = extractvalue { ptr, i32 } %319, 0
  store ptr %320, ptr %5, align 8
  %321 = extractvalue { ptr, i32 } %319, 1
  store i32 %321, ptr %6, align 4
  br label %356

322:                                              ; preds = %313
  call void @llvm.lifetime.start.p0(i64 4, ptr %33) #8
  %323 = load i32, ptr %32, align 4, !tbaa !5
  %324 = sext i32 %323 to i64
  %325 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %24, i64 noundef %324) #8
  %326 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %325) #8
  %327 = load i32, ptr %326, align 4, !tbaa !5
  store i32 %327, ptr %33, align 4, !tbaa !5
  %328 = load i32, ptr %33, align 4, !tbaa !5
  %329 = load i32, ptr %2, align 4, !tbaa !5
  %330 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %30, i32 noundef %328, i32 noundef %329)
          to label %331 unwind label %341

331:                                              ; preds = %322
  %332 = load i32, ptr %31, align 4, !tbaa !5
  %333 = sext i32 %332 to i64
  %334 = add nsw i64 %333, %330
  %335 = trunc i64 %334 to i32
  store i32 %335, ptr %31, align 4, !tbaa !5
  %336 = load i32, ptr %33, align 4, !tbaa !5
  invoke void @_ZN7SegTreeIxE6updateEix(ptr noundef nonnull align 8 dereferenceable(56) %30, i32 noundef %336, i64 noundef 1)
          to label %337 unwind label %341

337:                                              ; preds = %331
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  br label %338

338:                                              ; preds = %337
  %339 = load i32, ptr %32, align 4, !tbaa !5
  %340 = add nsw i32 %339, 1
  store i32 %340, ptr %32, align 4, !tbaa !5
  br label %313, !llvm.loop !22

341:                                              ; preds = %331, %322
  %342 = landingpad { ptr, i32 }
          cleanup
  %343 = extractvalue { ptr, i32 } %342, 0
  store ptr %343, ptr %5, align 8
  %344 = extractvalue { ptr, i32 } %342, 1
  store i32 %344, ptr %6, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %33) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %32) #8
  br label %355

345:                                              ; preds = %317
  %346 = load i32, ptr %31, align 4, !tbaa !5
  invoke void @_Z6ch_minIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %11, i32 noundef %346)
          to label %347 unwind label %351

347:                                              ; preds = %345
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  call void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %30) #8
  call void @llvm.lifetime.end.p0(i64 56, ptr %30) #8
  store i32 0, ptr %10, align 4
  br label %348

348:                                              ; preds = %347, %266
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #8
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #8
  %349 = load i32, ptr %10, align 4
  switch i32 %349, label %361 [
    i32 0, label %350
  ]

350:                                              ; preds = %348
  br label %360

351:                                              ; preds = %345
  %352 = landingpad { ptr, i32 }
          cleanup
  %353 = extractvalue { ptr, i32 } %352, 0
  store ptr %353, ptr %5, align 8
  %354 = extractvalue { ptr, i32 } %352, 1
  store i32 %354, ptr %6, align 4
  br label %355

355:                                              ; preds = %351, %341
  call void @llvm.lifetime.end.p0(i64 4, ptr %31) #8
  call void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %30) #8
  br label %356

356:                                              ; preds = %355, %318
  call void @llvm.lifetime.end.p0(i64 56, ptr %30) #8
  br label %357

357:                                              ; preds = %356, %304
  call void @llvm.lifetime.end.p0(i64 1, ptr %27) #8
  br label %358

358:                                              ; preds = %357, %224
  call void @llvm.lifetime.end.p0(i64 4, ptr %26) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %25) #8
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %24) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %24) #8
  br label %359

359:                                              ; preds = %358, %220, %177
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %16) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %16) #8
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %15) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %15) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %12) #8
  br label %390

360:                                              ; preds = %350, %134
  store i32 0, ptr %10, align 4
  br label %361

361:                                              ; preds = %360, %348
  call void @llvm.lifetime.end.p0(i64 4, ptr %13) #8
  %362 = load i32, ptr %10, align 4
  switch i32 %362, label %398 [
    i32 0, label %363
    i32 13, label %364
  ]

363:                                              ; preds = %361
  br label %364

364:                                              ; preds = %363, %361
  %365 = load i32, ptr %12, align 4, !tbaa !5
  %366 = add nsw i32 %365, 1
  store i32 %366, ptr %12, align 4, !tbaa !5
  br label %112, !llvm.loop !23

367:                                              ; preds = %117
  %368 = load i32, ptr %11, align 4, !tbaa !5
  %369 = icmp eq i32 %368, 100000
  br i1 %369, label %370, label %379

370:                                              ; preds = %367
  %371 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef -1)
          to label %372 unwind label %375

372:                                              ; preds = %370
  %373 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %371, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %374 unwind label %375

374:                                              ; preds = %372
  br label %385

375:                                              ; preds = %382, %379, %372, %370
  %376 = landingpad { ptr, i32 }
          cleanup
  %377 = extractvalue { ptr, i32 } %376, 0
  store ptr %377, ptr %5, align 8
  %378 = extractvalue { ptr, i32 } %376, 1
  store i32 %378, ptr %6, align 4
  br label %390

379:                                              ; preds = %367
  %380 = load i32, ptr %11, align 4, !tbaa !5
  %381 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %380)
          to label %382 unwind label %375

382:                                              ; preds = %379
  %383 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %381, ptr noundef @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %384 unwind label %375

384:                                              ; preds = %382
  br label %385

385:                                              ; preds = %384, %374
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  store i32 0, ptr %10, align 4
  br label %386

386:                                              ; preds = %385, %106
  call void @_ZNSt6vectorI4CardSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  %387 = load i32, ptr %10, align 4
  switch i32 %387, label %398 [
    i32 0, label %388
    i32 1, label %388
  ]

388:                                              ; preds = %386, %386
  %389 = load i32, ptr %1, align 4
  ret i32 %389

390:                                              ; preds = %375, %359
  call void @llvm.lifetime.end.p0(i64 4, ptr %11) #8
  br label %391

391:                                              ; preds = %390, %107, %77, %57
  call void @_ZNSt6vectorI4CardSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %3) #8
  br label %392

392:                                              ; preds = %391, %43
  call void @llvm.lifetime.end.p0(i64 24, ptr %3) #8
  call void @llvm.lifetime.end.p0(i64 4, ptr %2) #8
  br label %393

393:                                              ; preds = %392
  %394 = load ptr, ptr %5, align 8
  %395 = load i32, ptr %6, align 4
  %396 = insertvalue { ptr, i32 } poison, ptr %394, 0
  %397 = insertvalue { ptr, i32 } %396, i32 %395, 1
  resume { ptr, i32 } %397

398:                                              ; preds = %386, %361
  unreachable
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI4CardSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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) #3

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) #0

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) #7

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZNK3$_0cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZNK3$_1cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1)) #6 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SegTreeIxE6updateEix(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i64 noundef) #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6ch_minIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) #5

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

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

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

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

attributes #0 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn 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 #8 = { nounwind }
attributes #9 = { noreturn nounwind }

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

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

@_ZSt4cout = external global %"class.std::basic_ostream", align 8
@_ZSt3cin = external global %"class.std::basic_istream", align 8
@.str.2 = external hidden unnamed_addr constant [32 x i8], align 1
@.str.3 = external hidden unnamed_addr constant [85 x i8], align 1
@__PRETTY_FUNCTION__.main = external hidden unnamed_addr constant [11 x i8], align 1
@_ZSt4cerr = external global %"class.std::basic_ostream", align 8
@.str.4 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.5 = external hidden unnamed_addr constant [6 x i8], align 1
@.str.6 = external hidden unnamed_addr constant [3 x i8], align 1
@.str.7 = external hidden unnamed_addr constant [2 x i8], align 1
@func2 = external hidden global %class.anon, align 1
@_update2 = external hidden global %class.anon.12, align 1

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #0

; Function Attrs: mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) local_unnamed_addr #1 align 2

; Function Attrs: inlinehint mustprogress uwtable
declare noundef nonnull align 8 dereferenceable(8) ptr @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_(ptr noundef nonnull align 8 dereferenceable(8)) #0

; Function Attrs: mustprogress norecurse uwtable
define dso_local noundef i32 @main() local_unnamed_addr #2 personality ptr @__gxx_personality_v0 {
  %1 = alloca i32, align 4
  %2 = alloca %"class.std::vector", align 8
  %3 = alloca %"class.std::allocator", align 1
  %4 = alloca i32, align 4
  %5 = alloca %"class.std::vector.0", align 8
  %6 = alloca %"class.std::vector.0", align 8
  %7 = alloca i32, align 4
  %8 = alloca %"class.std::tuple", align 4
  %9 = alloca %"class.std::tuple", align 4
  %10 = alloca %"class.std::vector.0", align 8
  %11 = alloca %class.SegTree, align 8
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %1) #9
  %12 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %1)
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %2) #9
  %13 = load i32, ptr %1, align 4, !tbaa !5
  %14 = sext i32 %13 to i64
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %3) #9
  call void @_ZNSaI4CardEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #9
  invoke void @_ZNSt6vectorI4CardSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %14, ptr noundef nonnull align 1 dereferenceable(1) %3)
          to label %15 unwind label %19

15:                                               ; preds = %0
  call void @_ZNSt15__new_allocatorI4CardED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #9
  %16 = load i32, ptr %1, align 4, !tbaa !5
  %17 = icmp sgt i32 %16, 0
  br i1 %17, label %.lr.ph, label %.thread

.preheader92:                                     ; preds = %23
  %18 = icmp sgt i32 %24, 0
  br i1 %18, label %.lr.ph100, label %.thread

19:                                               ; preds = %0
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorI4CardED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %3) #9
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %3) #9
  br label %199

.lr.ph:                                           ; preds = %15, %23
  %indvars.iv = phi i64 [ %indvars.iv.next, %23 ], [ 0, %15 ]
  %21 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv) #9
  %22 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %21)
          to label %23 unwind label %27

23:                                               ; preds = %.lr.ph
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  %24 = load i32, ptr %1, align 4, !tbaa !5
  %25 = sext i32 %24 to i64
  %26 = icmp slt i64 %indvars.iv.next, %25
  br i1 %26, label %.lr.ph, label %.preheader92, !llvm.loop !9

27:                                               ; preds = %.lr.ph
  %28 = landingpad { ptr, i32 }
          cleanup
  br label %198

.thread:                                          ; preds = %.preheader92, %15
  %.lcssa96.ph = phi i32 [ %24, %.preheader92 ], [ %16, %15 ]
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  store i32 100000, ptr %4, align 4, !tbaa !5
  br label %.preheader90.preheader

.preheader91:                                     ; preds = %33
  %29 = icmp sgt i32 %34, 1
  br i1 %29, label %.lr.ph102, label %._crit_edge

.lr.ph100:                                        ; preds = %.preheader92, %33
  %indvars.iv135 = phi i64 [ %indvars.iv.next136, %33 ], [ 0, %.preheader92 ]
  %30 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv135) #9
  %31 = getelementptr inbounds i8, ptr %30, i64 4
  %32 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSirsERi(ptr noundef nonnull align 8 dereferenceable(16) @_ZSt3cin, ptr noundef nonnull align 4 dereferenceable(4) %31)
          to label %33 unwind label %37

33:                                               ; preds = %.lr.ph100
  %indvars.iv.next136 = add nuw nsw i64 %indvars.iv135, 1
  %34 = load i32, ptr %1, align 4, !tbaa !5
  %35 = sext i32 %34 to i64
  %36 = icmp slt i64 %indvars.iv.next136, %35
  br i1 %36, label %.lr.ph100, label %.preheader91, !llvm.loop !11

37:                                               ; preds = %.lr.ph100
  %38 = landingpad { ptr, i32 }
          cleanup
  br label %198

._crit_edge:                                      ; preds = %.lr.ph102, %.preheader91
  %39 = phi i32 [ %34, %.preheader91 ], [ %.pr, %.lr.ph102 ]
  %40 = icmp eq i32 %39, 1
  br i1 %40, label %46, label %52

.lr.ph102:                                        ; preds = %.preheader91, %.lr.ph102
  %indvars.iv138 = phi i64 [ %indvars.iv.next139, %.lr.ph102 ], [ 1, %.preheader91 ]
  %41 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv138) #9
  %42 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %indvars.iv138) #9
  %43 = getelementptr inbounds i8, ptr %42, i64 4
  call void @_ZSt4swapIiENSt9enable_ifIXsr6__and_ISt6__not_ISt15__is_tuple_likeIT_EESt21is_move_constructibleIS3_ESt18is_move_assignableIS3_EEE5valueEvE4typeERS3_SC_(ptr noundef nonnull align 4 dereferenceable(4) %41, ptr noundef nonnull align 4 dereferenceable(4) %43) #9
  %indvars.iv.next139 = add nuw nsw i64 %indvars.iv138, 2
  %.pr = load i32, ptr %1, align 4, !tbaa !5
  %44 = trunc nuw i64 %indvars.iv.next139 to i32
  %45 = icmp sgt i32 %.pr, %44
  br i1 %45, label %.lr.ph102, label %._crit_edge, !llvm.loop !12

46:                                               ; preds = %._crit_edge
  %47 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef 0)
          to label %48 unwind label %50

48:                                               ; preds = %46
  %49 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %47, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %196 unwind label %50

50:                                               ; preds = %48, %46
  %51 = landingpad { ptr, i32 }
          cleanup
  br label %198

52:                                               ; preds = %._crit_edge
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %4) #9
  store i32 100000, ptr %4, align 4, !tbaa !5
  %.not129 = icmp eq i32 %39, 31
  br i1 %.not129, label %._crit_edge128.thread, label %.preheader90.preheader

.preheader90.preheader:                           ; preds = %.thread, %52
  %.ph = phi i32 [ %39, %52 ], [ %.lcssa96.ph, %.thread ]
  br label %.preheader90

.preheader90:                                     ; preds = %.preheader90.preheader, %185
  %53 = phi i32 [ %187, %185 ], [ %.ph, %.preheader90.preheader ]
  %.069126 = phi i32 [ %186, %185 ], [ 0, %.preheader90.preheader ]
  %54 = icmp sgt i32 %53, 0
  br i1 %54, label %.lr.ph106.preheader, label %._crit_edge107

.lr.ph106.preheader:                              ; preds = %.preheader90
  %min.iters.check = icmp ult i32 %53, 8
  br i1 %min.iters.check, label %.lr.ph106.preheader176, label %vector.ph

.lr.ph106.preheader176:                           ; preds = %middle.block, %.lr.ph106.preheader
  %.067105.ph = phi i32 [ 0, %.lr.ph106.preheader ], [ %n.vec, %middle.block ]
  %.068104.ph = phi i32 [ 0, %.lr.ph106.preheader ], [ %62, %middle.block ]
  br label %.lr.ph106

vector.ph:                                        ; preds = %.lr.ph106.preheader
  %n.vec = and i32 %53, 2147483640
  %broadcast.splatinsert = insertelement <4 x i32> poison, i32 %.069126, i64 0
  %broadcast.splat = shufflevector <4 x i32> %broadcast.splatinsert, <4 x i32> poison, <4 x i32> zeroinitializer
  br label %vector.body

vector.body:                                      ; preds = %vector.body, %vector.ph
  %index = phi i32 [ 0, %vector.ph ], [ %index.next, %vector.body ]
  %vec.ind = phi <4 x i32> [ <i32 0, i32 1, i32 2, i32 3>, %vector.ph ], [ %vec.ind.next, %vector.body ]
  %vec.phi = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %59, %vector.body ]
  %vec.phi175 = phi <4 x i32> [ zeroinitializer, %vector.ph ], [ %60, %vector.body ]
  %step.add = add <4 x i32> %vec.ind, <i32 4, i32 4, i32 4, i32 4>
  %55 = lshr <4 x i32> %broadcast.splat, %vec.ind
  %56 = lshr <4 x i32> %broadcast.splat, %step.add
  %57 = and <4 x i32> %55, <i32 1, i32 1, i32 1, i32 1>
  %58 = and <4 x i32> %56, <i32 1, i32 1, i32 1, i32 1>
  %59 = add <4 x i32> %57, %vec.phi
  %60 = add <4 x i32> %58, %vec.phi175
  %index.next = add nuw i32 %index, 8
  %vec.ind.next = add <4 x i32> %vec.ind, <i32 8, i32 8, i32 8, i32 8>
  %61 = icmp eq i32 %index.next, %n.vec
  br i1 %61, label %middle.block, label %vector.body, !llvm.loop !13

middle.block:                                     ; preds = %vector.body
  %bin.rdx = add <4 x i32> %60, %59
  %62 = call i32 @llvm.vector.reduce.add.v4i32(<4 x i32> %bin.rdx)
  %cmp.n = icmp eq i32 %53, %n.vec
  br i1 %cmp.n, label %._crit_edge107, label %.lr.ph106.preheader176

._crit_edge128:                                   ; preds = %185
  %.pre = load i32, ptr %4, align 4, !tbaa !5
  %63 = icmp eq i32 %.pre, 100000
  br i1 %63, label %._crit_edge128.thread, label %.invoke163

._crit_edge107:                                   ; preds = %.lr.ph106, %middle.block, %.preheader90
  %.068.lcssa = phi i32 [ 0, %.preheader90 ], [ %62, %middle.block ], [ %68, %.lr.ph106 ]
  %.neg = sdiv i32 %53, -2
  %64 = add i32 %.neg, %53
  %65 = icmp eq i32 %.068.lcssa, %64
  br i1 %65, label %70, label %185

.lr.ph106:                                        ; preds = %.lr.ph106.preheader176, %.lr.ph106
  %.067105 = phi i32 [ %69, %.lr.ph106 ], [ %.067105.ph, %.lr.ph106.preheader176 ]
  %.068104 = phi i32 [ %68, %.lr.ph106 ], [ %.068104.ph, %.lr.ph106.preheader176 ]
  %66 = lshr i32 %.069126, %.067105
  %67 = and i32 %66, 1
  %68 = add nuw nsw i32 %67, %.068104
  %69 = add nuw nsw i32 %.067105, 1
  %exitcond.not = icmp eq i32 %69, %53
  br i1 %exitcond.not, label %._crit_edge107, label %.lr.ph106, !llvm.loop !16

70:                                               ; preds = %._crit_edge107
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #9
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #9
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %7) #9
  store i32 0, ptr %7, align 4, !tbaa !5
  %71 = load i32, ptr %1, align 4, !tbaa !5
  %72 = icmp sgt i32 %71, 0
  br i1 %72, label %.lr.ph111, label %._crit_edge112

._crit_edge112:                                   ; preds = %89, %70
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  %73 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  %74 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %73, ptr %74)
          to label %95 unwind label %112

.lr.ph111:                                        ; preds = %70, %89
  %storemerge109 = phi i32 [ %91, %89 ], [ 0, %70 ]
  %75 = shl nuw i32 1, %storemerge109
  %76 = and i32 %75, %.069126
  %.not = icmp eq i32 %76, 0
  %77 = sext i32 %storemerge109 to i64
  br i1 %.not, label %83, label %78

78:                                               ; preds = %.lr.ph111
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #9
  %79 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %77) #9
  call void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %8, ptr noundef nonnull align 4 dereferenceable(4) %79, ptr noundef nonnull align 4 dereferenceable(4) %7) #9
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %5, ptr noundef nonnull align 4 dereferenceable(8) %8)
          to label %80 unwind label %81

80:                                               ; preds = %78
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  br label %89

81:                                               ; preds = %78
  %82 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #9
  br label %94

83:                                               ; preds = %.lr.ph111
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #9
  %84 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorI4CardSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %2, i64 noundef %77) #9
  %85 = getelementptr inbounds i8, ptr %84, i64 4
  call void @_ZNSt5tupleIJiiEEC2IRiS2_TnNSt9enable_ifIXclsr4_TCCIXntcl14__is_alloc_argIT_EEEEE29__is_implicitly_constructibleIS4_T0_EEEbE4typeELb1EEEOS4_OS5_(ptr noundef nonnull align 4 dereferenceable(8) %9, ptr noundef nonnull align 4 dereferenceable(4) %85, ptr noundef nonnull align 4 dereferenceable(4) %7) #9
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backEOS1_(ptr noundef nonnull align 8 dereferenceable(24) %6, ptr noundef nonnull align 4 dereferenceable(8) %9)
          to label %86 unwind label %87

86:                                               ; preds = %83
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %89

87:                                               ; preds = %83
  %88 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #9
  br label %94

89:                                               ; preds = %80, %86
  %90 = load i32, ptr %7, align 4, !tbaa !5
  %91 = add nsw i32 %90, 1
  store i32 %91, ptr %7, align 4, !tbaa !5
  %92 = load i32, ptr %1, align 4, !tbaa !5
  %93 = icmp slt i32 %91, %92
  br i1 %93, label %.lr.ph111, label %._crit_edge112, !llvm.loop !17

94:                                               ; preds = %87, %81
  %.pn80 = phi { ptr, i32 } [ %82, %81 ], [ %88, %87 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %7) #9
  br label %184

95:                                               ; preds = %._crit_edge112
  %96 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  %97 = call ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  invoke void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr %96, ptr %97)
          to label %98 unwind label %112

98:                                               ; preds = %95
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %10) #9
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  %99 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  %100 = trunc i64 %99 to i32
  %101 = icmp sgt i32 %100, 0
  br i1 %101, label %.lr.ph116, label %._crit_edge117

.lr.ph116:                                        ; preds = %98, %116
  %indvars.iv141 = phi i64 [ %indvars.iv.next142, %116 ], [ 0, %98 ]
  %.053114 = phi i32 [ %.1, %116 ], [ 0, %98 ]
  %102 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv141) #9
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(8) %102)
          to label %103 unwind label %114

103:                                              ; preds = %.lr.ph116
  %indvars.iv.next142 = add nuw nsw i64 %indvars.iv141, 1
  %104 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  %105 = trunc i64 %104 to i32
  %106 = icmp slt i32 %.053114, %105
  br i1 %106, label %107, label %116

107:                                              ; preds = %103
  %108 = sext i32 %.053114 to i64
  %109 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %108) #9
  invoke void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EE9push_backERKS1_(ptr noundef nonnull align 8 dereferenceable(24) %10, ptr noundef nonnull align 4 dereferenceable(8) %109)
          to label %110 unwind label %114

110:                                              ; preds = %107
  %111 = add nsw i32 %.053114, 1
  br label %116

112:                                              ; preds = %95, %._crit_edge112
  %113 = landingpad { ptr, i32 }
          cleanup
  br label %184

114:                                              ; preds = %107, %.lr.ph116
  %115 = landingpad { ptr, i32 }
          cleanup
  br label %183

116:                                              ; preds = %110, %103
  %.1 = phi i32 [ %111, %110 ], [ %.053114, %103 ]
  %117 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  %sext = shl i64 %117, 32
  %118 = ashr exact i64 %sext, 32
  %119 = icmp slt i64 %indvars.iv.next142, %118
  br i1 %119, label %.lr.ph116, label %._crit_edge117, !llvm.loop !18

._crit_edge117:                                   ; preds = %116, %98
  %120 = call noundef i64 @_ZNKSt6vectorISt5tupleIJiiEESaIS1_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  %121 = trunc i64 %120 to i32
  %122 = load i32, ptr %1, align 4, !tbaa !5
  %123 = icmp eq i32 %122, %121
  br i1 %123, label %.preheader89.preheader, label %124

.preheader89.preheader:                           ; preds = %._crit_edge117
  %.not.not171 = icmp sgt i32 %122, 1
  br i1 %.not.not171, label %.lr.ph173, label %.critedge.preheader

124:                                              ; preds = %._crit_edge117
  call void @__assert_fail(ptr noundef nonnull @.str.2, ptr noundef nonnull @.str.3, i32 noundef 339, ptr noundef nonnull @__PRETTY_FUNCTION__.main) #10
  unreachable

.preheader89thread-pre-split:                     ; preds = %.lr.ph173
  %.pr155 = load i32, ptr %1, align 4, !tbaa !5
  %125 = add nsw i32 %.pr155, -1
  %126 = sext i32 %125 to i64
  %.not.not = icmp slt i64 %indvars.iv.next145, %126
  br i1 %.not.not, label %.lr.ph173, label %.critedge.preheader

.critedge.preheader:                              ; preds = %.preheader89thread-pre-split, %.preheader89.preheader
  %.lcssa165 = phi i32 [ %122, %.preheader89.preheader ], [ %.pr155, %.preheader89thread-pre-split ]
  %127 = icmp sgt i32 %.lcssa165, 0
  br i1 %127, label %.lr.ph119, label %.critedge._crit_edge

.lr.ph173:                                        ; preds = %.preheader89.preheader, %.preheader89thread-pre-split
  %indvars.iv144172 = phi i64 [ %indvars.iv.next145, %.preheader89thread-pre-split ], [ 0, %.preheader89.preheader ]
  %128 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv144172) #9
  %129 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %128) #9
  %130 = load i32, ptr %129, align 4, !tbaa !5
  %indvars.iv.next145 = add nuw nsw i64 %indvars.iv144172, 1
  %131 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv.next145) #9
  %132 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %131) #9
  %133 = load i32, ptr %132, align 4, !tbaa !5
  %134 = icmp sgt i32 %130, %133
  br i1 %134, label %.critedge88, label %.preheader89thread-pre-split, !llvm.loop !19

.critedge._crit_edge:                             ; preds = %.critedge, %.critedge.preheader
  %.lcssa = phi i32 [ %.lcssa165, %.critedge.preheader ], [ %161, %.critedge ]
  call void @llvm.lifetime.start.p0(i64 56, ptr nonnull %11) #9
  %135 = call noundef ptr @"_ZNK3$_0cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1) @func2) #9
  %136 = call noundef ptr @"_ZNK3$_1cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1) @_update2) #9
  invoke void @_ZN7SegTreeIxEC2EixPFxxxES2_(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %.lcssa, i64 noundef 0, ptr noundef %135, ptr noundef %136)
          to label %.preheader unwind label %166

.preheader:                                       ; preds = %.critedge._crit_edge
  %137 = load i32, ptr %1, align 4, !tbaa !5
  %138 = icmp sgt i32 %137, 0
  br i1 %138, label %.lr.ph123, label %._crit_edge124

.lr.ph119:                                        ; preds = %.critedge.preheader, %.critedge
  %indvars.iv147 = phi i64 [ %indvars.iv.next148, %.critedge ], [ 0, %.critedge.preheader ]
  %139 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cerr, ptr noundef nonnull @.str.4)
          to label %140 unwind label %164

140:                                              ; preds = %.lr.ph119
  %141 = trunc nuw nsw i64 %indvars.iv147 to i32
  %142 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %139, i32 noundef %141)
          to label %143 unwind label %164

143:                                              ; preds = %140
  %144 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %142, ptr noundef nonnull @.str.5)
          to label %145 unwind label %164

145:                                              ; preds = %143
  %146 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv147) #9
  %147 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm0EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %146) #9
  %148 = load i32, ptr %147, align 4, !tbaa !5
  %149 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %144, i32 noundef %148)
          to label %150 unwind label %164

150:                                              ; preds = %145
  %151 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %149, ptr noundef nonnull @.str.6)
          to label %152 unwind label %164

152:                                              ; preds = %150
  %153 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv147) #9
  %154 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %153) #9
  %155 = load i32, ptr %154, align 4, !tbaa !5
  %156 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) %151, i32 noundef %155)
          to label %157 unwind label %164

157:                                              ; preds = %152
  %158 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZStlsISt11char_traitsIcEERSt13basic_ostreamIcT_ES5_PKc(ptr noundef nonnull align 8 dereferenceable(8) %156, ptr noundef nonnull @.str.7)
          to label %159 unwind label %164

159:                                              ; preds = %157
  %160 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %158, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %.critedge unwind label %164

.critedge:                                        ; preds = %159
  %indvars.iv.next148 = add nuw nsw i64 %indvars.iv147, 1
  %161 = load i32, ptr %1, align 4, !tbaa !5
  %162 = sext i32 %161 to i64
  %163 = icmp slt i64 %indvars.iv.next148, %162
  br i1 %163, label %.lr.ph119, label %.critedge._crit_edge, !llvm.loop !20

164:                                              ; preds = %159, %157, %152, %150, %145, %143, %140, %.lr.ph119
  %165 = landingpad { ptr, i32 }
          cleanup
  br label %183

._crit_edge124:                                   ; preds = %174, %.preheader
  %.049.lcssa = phi i32 [ 0, %.preheader ], [ %176, %174 ]
  call void @_Z6ch_minIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4) %4, i32 noundef %.049.lcssa)
  call void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #9
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #9
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #9
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  br label %185

166:                                              ; preds = %.critedge._crit_edge
  %167 = landingpad { ptr, i32 }
          cleanup
  br label %182

.lr.ph123:                                        ; preds = %.preheader, %174
  %indvars.iv150 = phi i64 [ %indvars.iv.next151, %174 ], [ 0, %.preheader ]
  %.049121 = phi i32 [ %176, %174 ], [ 0, %.preheader ]
  %168 = call noundef nonnull align 4 dereferenceable(8) ptr @_ZNSt6vectorISt5tupleIJiiEESaIS1_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %indvars.iv150) #9
  %169 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZSt3getILm1EJiiEERNSt13tuple_elementIXT_ESt5tupleIJDpT0_EEE4typeERS4_(ptr noundef nonnull align 4 dereferenceable(8) %168) #9
  %170 = load i32, ptr %169, align 4, !tbaa !5
  %171 = load i32, ptr %1, align 4, !tbaa !5
  %172 = invoke noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %170, i32 noundef %171)
          to label %173 unwind label %180

173:                                              ; preds = %.lr.ph123
  invoke void @_ZN7SegTreeIxE6updateEix(ptr noundef nonnull align 8 dereferenceable(56) %11, i32 noundef %170, i64 noundef 1)
          to label %174 unwind label %180

174:                                              ; preds = %173
  %175 = trunc i64 %172 to i32
  %176 = add i32 %.049121, %175
  %indvars.iv.next151 = add nuw nsw i64 %indvars.iv150, 1
  %177 = load i32, ptr %1, align 4, !tbaa !5
  %178 = sext i32 %177 to i64
  %179 = icmp slt i64 %indvars.iv.next151, %178
  br i1 %179, label %.lr.ph123, label %._crit_edge124, !llvm.loop !21

180:                                              ; preds = %173, %.lr.ph123
  %181 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN7SegTreeIxED2Ev(ptr noundef nonnull align 8 dereferenceable(56) %11) #9
  br label %182

182:                                              ; preds = %180, %166
  %.pn = phi { ptr, i32 } [ %181, %180 ], [ %167, %166 ]
  call void @llvm.lifetime.end.p0(i64 56, ptr nonnull %11) #9
  br label %183

183:                                              ; preds = %164, %182, %114
  %.pn78 = phi { ptr, i32 } [ %115, %114 ], [ %165, %164 ], [ %.pn, %182 ]
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #9
  br label %184

184:                                              ; preds = %183, %112, %94
  %.pn80.pn = phi { ptr, i32 } [ %.pn80, %94 ], [ %.pn78, %183 ], [ %113, %112 ]
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  br label %197

.critedge88:                                      ; preds = %.lr.ph173
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %10) #9
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #9
  call void @_ZNSt6vectorISt5tupleIJiiEESaIS1_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #9
  br label %185

185:                                              ; preds = %._crit_edge124, %._crit_edge107, %.critedge88
  %186 = add nuw nsw i32 %.069126, 1
  %187 = load i32, ptr %1, align 4, !tbaa !5
  %188 = shl nuw i32 1, %187
  %189 = icmp slt i32 %186, %188
  br i1 %189, label %.preheader90, label %._crit_edge128, !llvm.loop !22

._crit_edge128.thread:                            ; preds = %52, %._crit_edge128
  br label %.invoke163

190:                                              ; preds = %.invoke163, %.invoke
  %191 = landingpad { ptr, i32 }
          cleanup
  br label %197

.invoke163:                                       ; preds = %._crit_edge128, %._crit_edge128.thread
  %192 = phi i32 [ -1, %._crit_edge128.thread ], [ %.pre, %._crit_edge128 ]
  %193 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEi(ptr noundef nonnull align 8 dereferenceable(8) @_ZSt4cout, i32 noundef %192)
          to label %.invoke unwind label %190

.invoke:                                          ; preds = %.invoke163
  %194 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZNSolsEPFRSoS_E(ptr noundef nonnull align 8 dereferenceable(8) %193, ptr noundef nonnull @_ZSt4endlIcSt11char_traitsIcEERSt13basic_ostreamIT_T0_ES6_)
          to label %195 unwind label %190

195:                                              ; preds = %.invoke
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  br label %196

196:                                              ; preds = %48, %195
  call void @_ZNSt6vectorI4CardSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  ret i32 0

197:                                              ; preds = %190, %184
  %.pn80.pn.pn = phi { ptr, i32 } [ %.pn80.pn, %184 ], [ %191, %190 ]
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %4) #9
  br label %198

198:                                              ; preds = %197, %50, %37, %27
  %.pn84 = phi { ptr, i32 } [ %28, %27 ], [ %38, %37 ], [ %51, %50 ], [ %.pn80.pn.pn, %197 ]
  call void @_ZNSt6vectorI4CardSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %2) #9
  br label %199

199:                                              ; preds = %198, %19
  %.pn84.pn = phi { ptr, i32 } [ %.pn84, %198 ], [ %20, %19 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %2) #9
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %1) #9
  resume { ptr, i32 } %.pn84.pn
}

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

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt6vectorI4CardSaIS0_EEC2EmRKS1_(ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1 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) #3

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt4sortIN9__gnu_cxx17__normal_iteratorIPSt5tupleIJiiEESt6vectorIS3_SaIS3_EEEEEvT_S9_(ptr, ptr) local_unnamed_addr #0

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

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

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

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

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

; Function Attrs: noreturn nounwind
declare void @__assert_fail(ptr noundef, ptr noundef, i32 noundef, ptr noundef) local_unnamed_addr #7

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

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

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZNK3$_0cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6 align 2

; Function Attrs: inlinehint mustprogress nounwind uwtable
declare hidden noundef ptr @"_ZNK3$_1cvPFDaT_T0_EIxxEEv"(ptr noundef nonnull align 1 dereferenceable(1)) local_unnamed_addr #6 align 2

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef i64 @_ZN7SegTreeIxE4findEii(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i32 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN7SegTreeIxE6updateEix(ptr noundef nonnull align 8 dereferenceable(56), i32 noundef, i64 noundef) local_unnamed_addr #1 align 2

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_Z6ch_minIiEvRT_S0_(ptr noundef nonnull align 4 dereferenceable(4), i32 noundef) local_unnamed_addr #5

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

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

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

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

; Function Attrs: nocallback nofree nosync nounwind speculatable willreturn memory(none)
declare i32 @llvm.vector.reduce.add.v4i32(<4 x i32>) #8

attributes #0 = { inlinehint mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #1 = { 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 #2 = { mustprogress norecurse uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #3 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #4 = { "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 = { mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #7 = { noreturn 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 #8 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }
attributes #9 = { nounwind }
attributes #10 = { noreturn nounwind }

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

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


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