; LLVM IR from tommasocerruti/algolab-2024 :: src/week05/asterix_the_gaul/solution.ll (Z14split_and_listiRSt6vectorI4moveSaIS0_EEll)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<move, std::allocator<move>>::_Vector_impl" }
%"struct.std::_Vector_base<move, std::allocator<move>>::_Vector_impl" = type { %"struct.std::_Vector_base<move, std::allocator<move>>::_Vector_impl_data" }
%"struct.std::_Vector_base<move, std::allocator<move>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%class.anon = type { i8 }
%struct.move = type { i64, i64 }

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10subset_sumiiRSt6vectorI4moveSaIS0_EES3_ll(i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z14split_and_listiRSt6vectorI4moveSaIS0_EEll(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2, i64 noundef %3) #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca i1, align 1
  %6 = alloca i32, align 4
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca i64, align 8
  %10 = alloca %"class.std::vector", align 8
  %11 = alloca %"class.std::vector", align 8
  %12 = alloca ptr, align 8
  %13 = alloca i32, align 4
  %14 = alloca i32, align 4
  %15 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %17 = alloca %class.anon, align 1
  %18 = alloca i32, align 4
  %19 = alloca ptr, align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %22 = alloca %struct.move, align 8
  %23 = alloca %struct.move, align 8
  %24 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %27 = alloca %class.anon, align 1
  %28 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  store i32 %0, ptr %6, align 4, !tbaa !5
  store ptr %1, ptr %7, align 8, !tbaa !9
  store i64 %2, ptr %8, align 8, !tbaa !11
  store i64 %3, ptr %9, align 8, !tbaa !11
  call void @llvm.lifetime.start.p0(i64 24, ptr %10) #6
  call void @_ZNSt6vectorI4moveSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.start.p0(i64 24, ptr %11) #6
  call void @_ZNSt6vectorI4moveSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %29 = load i32, ptr %6, align 4, !tbaa !5
  %30 = sdiv i32 %29, 2
  %31 = load ptr, ptr %7, align 8, !tbaa !9
  %32 = load i64, ptr %8, align 8, !tbaa !11
  %33 = load i64, ptr %9, align 8, !tbaa !11
  %34 = invoke noundef zeroext i1 @_Z10subset_sumiiRSt6vectorI4moveSaIS0_EES3_ll(i32 noundef 0, i32 noundef %30, ptr noundef nonnull align 8 dereferenceable(24) %31, ptr noundef nonnull align 8 dereferenceable(24) %10, i64 noundef %32, i64 noundef %33)
          to label %35 unwind label %37

35:                                               ; preds = %4
  br i1 %34, label %36, label %41

36:                                               ; preds = %35
  store i1 true, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %156

37:                                               ; preds = %51, %41, %4
  %38 = landingpad { ptr, i32 }
          cleanup
  %39 = extractvalue { ptr, i32 } %38, 0
  store ptr %39, ptr %12, align 8
  %40 = extractvalue { ptr, i32 } %38, 1
  store i32 %40, ptr %13, align 4
  br label %158

41:                                               ; preds = %35
  %42 = load i32, ptr %6, align 4, !tbaa !5
  %43 = sdiv i32 %42, 2
  %44 = load i32, ptr %6, align 4, !tbaa !5
  %45 = load ptr, ptr %7, align 8, !tbaa !9
  %46 = load i64, ptr %8, align 8, !tbaa !11
  %47 = load i64, ptr %9, align 8, !tbaa !11
  %48 = invoke noundef zeroext i1 @_Z10subset_sumiiRSt6vectorI4moveSaIS0_EES3_ll(i32 noundef %43, i32 noundef %44, ptr noundef nonnull align 8 dereferenceable(24) %45, ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %46, i64 noundef %47)
          to label %49 unwind label %37

49:                                               ; preds = %41
  br i1 %48, label %50, label %51

50:                                               ; preds = %49
  store i1 true, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %156

51:                                               ; preds = %49
  %52 = call ptr @_ZNSt6vectorI4moveSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %53 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  store ptr %52, ptr %53, align 8
  %54 = call ptr @_ZNSt6vectorI4moveSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %55 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  store ptr %54, ptr %55, align 8
  %56 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %15, i32 0, i32 0
  %57 = load ptr, ptr %56, align 8
  %58 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %16, i32 0, i32 0
  %59 = load ptr, ptr %58, align 8
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS2_SaIS2_EEEE3$_0EvT_S9_T0_"(ptr %57, ptr %59)
          to label %60 unwind label %37

60:                                               ; preds = %51
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #6
  %61 = call noundef i64 @_ZNKSt6vectorI4moveSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %62 = trunc i64 %61 to i32
  %63 = sub nsw i32 %62, 2
  store i32 %63, ptr %18, align 4, !tbaa !5
  br label %64

64:                                               ; preds = %85, %60
  %65 = load i32, ptr %18, align 4, !tbaa !5
  %66 = icmp sge i32 %65, 0
  br i1 %66, label %68, label %67

67:                                               ; preds = %64
  store i32 2, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %92

68:                                               ; preds = %64
  %69 = load i32, ptr %18, align 4, !tbaa !5
  %70 = add nsw i32 %69, 1
  %71 = sext i32 %70 to i64
  %72 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4moveSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %71) #6
  %73 = getelementptr inbounds %struct.move, ptr %72, i32 0, i32 0
  %74 = load i32, ptr %18, align 4, !tbaa !5
  %75 = sext i32 %74 to i64
  %76 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4moveSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %75) #6
  %77 = getelementptr inbounds %struct.move, ptr %76, i32 0, i32 0
  %78 = invoke noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %73, ptr noundef nonnull align 8 dereferenceable(8) %77)
          to label %79 unwind label %88

79:                                               ; preds = %68
  %80 = load i64, ptr %78, align 8, !tbaa !11
  %81 = load i32, ptr %18, align 4, !tbaa !5
  %82 = sext i32 %81 to i64
  %83 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4moveSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %11, i64 noundef %82) #6
  %84 = getelementptr inbounds %struct.move, ptr %83, i32 0, i32 0
  store i64 %80, ptr %84, align 8, !tbaa !13
  br label %85

85:                                               ; preds = %79
  %86 = load i32, ptr %18, align 4, !tbaa !5
  %87 = add nsw i32 %86, -1
  store i32 %87, ptr %18, align 4, !tbaa !5
  br label %64, !llvm.loop !15

88:                                               ; preds = %68
  %89 = landingpad { ptr, i32 }
          cleanup
  %90 = extractvalue { ptr, i32 } %89, 0
  store ptr %90, ptr %12, align 8
  %91 = extractvalue { ptr, i32 } %89, 1
  store i32 %91, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #6
  br label %158

92:                                               ; preds = %67
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #6
  store ptr %10, ptr %19, align 8, !tbaa !9
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #6
  %93 = load ptr, ptr %19, align 8, !tbaa !9
  %94 = call ptr @_ZNSt6vectorI4moveSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %93) #6
  %95 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %94, ptr %95, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %21) #6
  %96 = load ptr, ptr %19, align 8, !tbaa !9
  %97 = call ptr @_ZNSt6vectorI4moveSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %96) #6
  %98 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %21, i32 0, i32 0
  store ptr %97, ptr %98, align 8
  br label %99

99:                                               ; preds = %151, %92
  %100 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4moveSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %20, ptr noundef nonnull align 8 dereferenceable(8) %21) #6
  br i1 %100, label %102, label %101

101:                                              ; preds = %99
  store i32 5, ptr %14, align 4
  br label %153

102:                                              ; preds = %99
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #6
  %103 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %22, ptr align 8 %103, i64 16, i1 false), !tbaa.struct !17
  call void @llvm.lifetime.start.p0(i64 16, ptr %23) #6
  %104 = getelementptr inbounds %struct.move, ptr %23, i32 0, i32 0
  %105 = load i64, ptr %8, align 8, !tbaa !11
  %106 = getelementptr inbounds %struct.move, ptr %22, i32 0, i32 0
  %107 = load i64, ptr %106, align 8, !tbaa !13
  %108 = sub nsw i64 %105, %107
  store i64 %108, ptr %104, align 8, !tbaa !13
  %109 = getelementptr inbounds %struct.move, ptr %23, i32 0, i32 1
  %110 = load i64, ptr %9, align 8, !tbaa !11
  %111 = getelementptr inbounds %struct.move, ptr %22, i32 0, i32 1
  %112 = load i64, ptr %111, align 8, !tbaa !18
  %113 = sub nsw i64 %110, %112
  store i64 %113, ptr %109, align 8, !tbaa !18
  call void @llvm.lifetime.start.p0(i64 8, ptr %24) #6
  %114 = call ptr @_ZNSt6vectorI4moveSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %115 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  store ptr %114, ptr %115, align 8
  %116 = call ptr @_ZNSt6vectorI4moveSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %117 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  store ptr %116, ptr %117, align 8
  %118 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %25, i32 0, i32 0
  %119 = load ptr, ptr %118, align 8
  %120 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %26, i32 0, i32 0
  %121 = load ptr, ptr %120, align 8
  %122 = invoke ptr @"_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS2_SaIS2_EEEES2_3$_0ET_S9_S9_RKT0_T1_"(ptr %119, ptr %121, ptr noundef nonnull align 8 dereferenceable(16) %23)
          to label %123 unwind label %140

123:                                              ; preds = %102
  %124 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %24, i32 0, i32 0
  store ptr %122, ptr %124, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %28) #6
  %125 = call ptr @_ZNSt6vectorI4moveSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  %126 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %28, i32 0, i32 0
  store ptr %125, ptr %126, align 8
  %127 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4moveSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef nonnull align 8 dereferenceable(8) %28) #6
  br i1 %127, label %128, label %137

128:                                              ; preds = %123
  %129 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %24) #6
  %130 = getelementptr inbounds %struct.move, ptr %129, i32 0, i32 0
  %131 = load i64, ptr %130, align 8, !tbaa !13
  %132 = getelementptr inbounds %struct.move, ptr %22, i32 0, i32 0
  %133 = load i64, ptr %132, align 8, !tbaa !13
  %134 = add nsw i64 %131, %133
  %135 = load i64, ptr %8, align 8, !tbaa !11
  %136 = icmp sge i64 %134, %135
  br label %137

137:                                              ; preds = %128, %123
  %138 = phi i1 [ false, %123 ], [ %136, %128 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr %28) #6
  br i1 %138, label %139, label %144

139:                                              ; preds = %137
  store i1 true, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %145

140:                                              ; preds = %102
  %141 = landingpad { ptr, i32 }
          cleanup
  %142 = extractvalue { ptr, i32 } %141, 0
  store ptr %142, ptr %12, align 8
  %143 = extractvalue { ptr, i32 } %141, 1
  store i32 %143, ptr %13, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  br label %158

144:                                              ; preds = %137
  store i32 0, ptr %14, align 4
  br label %145

145:                                              ; preds = %144, %139
  call void @llvm.lifetime.end.p0(i64 8, ptr %24) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr %23) #6
  %146 = load i32, ptr %14, align 4
  switch i32 %146, label %148 [
    i32 0, label %147
  ]

147:                                              ; preds = %145
  store i32 0, ptr %14, align 4
  br label %148

148:                                              ; preds = %147, %145
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #6
  %149 = load i32, ptr %14, align 4
  switch i32 %149, label %153 [
    i32 0, label %150
  ]

150:                                              ; preds = %148
  br label %151

151:                                              ; preds = %150
  %152 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %20) #6
  br label %99

153:                                              ; preds = %148, %101
  call void @llvm.lifetime.end.p0(i64 8, ptr %21) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #6
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #6
  %154 = load i32, ptr %14, align 4
  switch i32 %154, label %156 [
    i32 5, label %155
  ]

155:                                              ; preds = %153
  store i1 false, ptr %5, align 1
  store i32 1, ptr %14, align 4
  br label %156

156:                                              ; preds = %155, %153, %50, %36
  call void @_ZNSt6vectorI4moveSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @_ZNSt6vectorI4moveSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  %157 = load i1, ptr %5, align 1
  ret i1 %157

158:                                              ; preds = %140, %88, %37
  call void @_ZNSt6vectorI4moveSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %11) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %11) #6
  call void @_ZNSt6vectorI4moveSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %10) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr %10) #6
  br label %159

159:                                              ; preds = %158
  %160 = load ptr, ptr %12, align 8
  %161 = load i32, ptr %13, align 4
  %162 = insertvalue { ptr, i32 } poison, ptr %160, 0
  %163 = insertvalue { ptr, i32 } %162, i32 %161, 1
  resume { ptr, i32 } %163
}

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS2_SaIS2_EEEE3$_0EvT_S9_T0_"(ptr, ptr) #3

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

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden ptr @"_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS2_SaIS2_EEEES2_3$_0ET_S9_S9_RKT0_T1_"(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(16)) #3

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

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

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

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

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

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


; Optimized IR (opt -passes='default<O3>'):
target datalayout = "e-m:e-p270:32:32-p271:32:32-p272:64:64-i64:64-i128:128-f80:128-n8:16:32:64-S128"
target triple = "x86_64-unknown-linux-gnu"

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

; Function Attrs: mustprogress uwtable
declare dso_local noundef zeroext i1 @_Z10subset_sumiiRSt6vectorI4moveSaIS0_EES3_ll(i32 noundef, i32 noundef, ptr noundef nonnull align 8 dereferenceable(24), ptr noundef nonnull align 8 dereferenceable(24), i64 noundef, i64 noundef) local_unnamed_addr #0

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local noundef zeroext i1 @_Z14split_and_listiRSt6vectorI4moveSaIS0_EEll(i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, i64 noundef %2, i64 noundef %3) local_unnamed_addr #0 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector", align 8
  %6 = alloca %"class.std::vector", align 8
  %7 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %8 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %9 = alloca %struct.move, align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #5
  call void @_ZNSt6vectorI4moveSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNSt6vectorI4moveSaIS0_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %12 = sdiv i32 %0, 2
  %13 = invoke noundef zeroext i1 @_Z10subset_sumiiRSt6vectorI4moveSaIS0_EES3_ll(i32 noundef 0, i32 noundef %12, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %2, i64 noundef %3)
          to label %14 unwind label %15

14:                                               ; preds = %4
  br i1 %13, label %59, label %17

15:                                               ; preds = %20, %17, %4
  %16 = landingpad { ptr, i32 }
          cleanup
  br label %60

17:                                               ; preds = %14
  %18 = invoke noundef zeroext i1 @_Z10subset_sumiiRSt6vectorI4moveSaIS0_EES3_ll(i32 noundef %12, i32 noundef %0, ptr noundef nonnull align 8 dereferenceable(24) %1, ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %2, i64 noundef %3)
          to label %19 unwind label %15

19:                                               ; preds = %17
  br i1 %18, label %59, label %20

20:                                               ; preds = %19
  %21 = call ptr @_ZNSt6vectorI4moveSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %22 = call ptr @_ZNSt6vectorI4moveSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS2_SaIS2_EEEE3$_0EvT_S9_T0_"(ptr %21, ptr %22)
          to label %23 unwind label %15

23:                                               ; preds = %20
  %24 = call noundef i64 @_ZNKSt6vectorI4moveSaIS0_EE4sizeEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %25 = trunc i64 %24 to i32
  %26 = icmp sgt i32 %25, 1
  br i1 %26, label %.lr.ph.preheader, label %._crit_edge

.lr.ph.preheader:                                 ; preds = %23
  %27 = add i64 %24, 4294967294
  %28 = and i64 %27, 4294967295
  br label %.lr.ph

._crit_edge:                                      ; preds = %.lr.ph, %23
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %7) #5
  %29 = call ptr @_ZNSt6vectorI4moveSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  store ptr %29, ptr %7, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %8) #5
  %30 = call ptr @_ZNSt6vectorI4moveSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  store ptr %30, ptr %8, align 8
  %31 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4moveSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %31, label %.lr.ph43, label %.loopexit

.lr.ph43:                                         ; preds = %._crit_edge
  %32 = getelementptr inbounds i8, ptr %9, i64 8
  br label %39

.lr.ph:                                           ; preds = %.lr.ph.preheader, %.lr.ph
  %indvars.iv = phi i64 [ %28, %.lr.ph.preheader ], [ %indvars.iv.next, %.lr.ph ]
  %33 = add nuw nsw i64 %indvars.iv, 1
  %34 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4moveSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %33) #5
  %35 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4moveSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv) #5
  %36 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZSt3maxIlERKT_S2_S2_(ptr noundef nonnull align 8 dereferenceable(8) %34, ptr noundef nonnull align 8 dereferenceable(8) %35)
  %37 = load i64, ptr %36, align 8, !tbaa !5
  %38 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorI4moveSaIS0_EEixEm(ptr noundef nonnull align 8 dereferenceable(24) %6, i64 noundef %indvars.iv) #5
  store i64 %37, ptr %38, align 8, !tbaa !9
  %indvars.iv.next = add nsw i64 %indvars.iv, -1
  %.not48 = icmp eq i64 %indvars.iv, 0
  br i1 %.not48, label %._crit_edge, label %.lr.ph, !llvm.loop !11

39:                                               ; preds = %.lr.ph43, %.critedge38
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS1_SaIS1_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %.sroa.04.0.copyload = load i64, ptr %40, align 8, !tbaa !5
  %.sroa.6.0..sroa_idx = getelementptr inbounds i8, ptr %40, i64 8
  %.sroa.6.0.copyload = load i64, ptr %.sroa.6.0..sroa_idx, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %9) #5
  %41 = sub nsw i64 %2, %.sroa.04.0.copyload
  store i64 %41, ptr %9, align 8, !tbaa !9
  %42 = sub nsw i64 %3, %.sroa.6.0.copyload
  store i64 %42, ptr %32, align 8, !tbaa !13
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #5
  %43 = call ptr @_ZNSt6vectorI4moveSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %44 = call ptr @_ZNSt6vectorI4moveSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  %45 = invoke ptr @"_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS2_SaIS2_EEEES2_3$_0ET_S9_S9_RKT0_T1_"(ptr %43, ptr %44, ptr noundef nonnull align 8 dereferenceable(16) %9)
          to label %46 unwind label %53

46:                                               ; preds = %39
  store ptr %45, ptr %10, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %11) #5
  %47 = call ptr @_ZNSt6vectorI4moveSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  store ptr %47, ptr %11, align 8
  %48 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4moveSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %10, ptr noundef nonnull align 8 dereferenceable(8) %11) #5
  br i1 %48, label %49, label %.critedge

49:                                               ; preds = %46
  %50 = call noundef ptr @_ZNK9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS1_SaIS1_EEEptEv(ptr noundef nonnull align 8 dereferenceable(8) %10) #5
  %51 = load i64, ptr %50, align 8, !tbaa !9
  %52 = add nsw i64 %51, %.sroa.04.0.copyload
  %.not = icmp slt i64 %52, %2
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br i1 %.not, label %.critedge38, label %57

53:                                               ; preds = %39
  %54 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %60

.critedge:                                        ; preds = %46
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %11) #5
  br label %.critedge38

.critedge38:                                      ; preds = %.critedge, %49
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  %55 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS1_SaIS1_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %7) #5
  %56 = call noundef zeroext i1 @_ZN9__gnu_cxxneIP4moveSt6vectorIS1_SaIS1_EEEEbRKNS_17__normal_iteratorIT_T0_EESB_(ptr noundef nonnull align 8 dereferenceable(8) %7, ptr noundef nonnull align 8 dereferenceable(8) %8) #5
  br i1 %56, label %39, label %.loopexit

57:                                               ; preds = %49
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #5
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %9) #5
  br label %.loopexit

.loopexit:                                        ; preds = %.critedge38, %._crit_edge, %57
  %58 = phi i1 [ true, %57 ], [ false, %._crit_edge ], [ false, %.critedge38 ]
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %8) #5
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %7) #5
  br label %59

59:                                               ; preds = %.loopexit, %19, %14
  %.3 = phi i1 [ true, %14 ], [ true, %19 ], [ %58, %.loopexit ]
  call void @_ZNSt6vectorI4moveSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNSt6vectorI4moveSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  ret i1 %.3

60:                                               ; preds = %53, %15
  %.pn = phi { ptr, i32 } [ %54, %53 ], [ %16, %15 ]
  call void @_ZNSt6vectorI4moveSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %6) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %6) #5
  call void @_ZNSt6vectorI4moveSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #5
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #5
  resume { ptr, i32 } %.pn
}

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

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS2_SaIS2_EEEE3$_0EvT_S9_T0_"(ptr, ptr) local_unnamed_addr #3

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

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

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

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden ptr @"_ZSt11upper_boundIN9__gnu_cxx17__normal_iteratorIP4moveSt6vectorIS2_SaIS2_EEEES2_3$_0ET_S9_S9_RKT0_T1_"(ptr, ptr, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #3

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

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

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

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

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

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


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