; LLVM IR from pixelsdb/mini-pixels :: pixels-common/lib/physical/scheduler (SortMergeScheduler)

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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<ByteBuffer>, std::allocator<std::shared_ptr<ByteBuffer>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<ByteBuffer>, std::allocator<std::shared_ptr<ByteBuffer>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<ByteBuffer>, std::allocator<std::shared_ptr<ByteBuffer>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<ByteBuffer>, std::allocator<std::shared_ptr<ByteBuffer>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::shared_ptr<MergedRequest>, std::allocator<std::shared_ptr<MergedRequest>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<MergedRequest>, std::allocator<std::shared_ptr<MergedRequest>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<MergedRequest>, std::allocator<std::shared_ptr<MergedRequest>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<MergedRequest>, std::allocator<std::shared_ptr<MergedRequest>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.RequestBatch = type { i32, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Request, std::allocator<Request>>::_Vector_impl" }
%"struct.std::_Vector_base<Request, std::allocator<Request>>::_Vector_impl" = type { %"struct.std::_Vector_base<Request, std::allocator<Request>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Request, std::allocator<Request>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::shared_ptr.10" = type { %"class.std::__shared_ptr.11" }
%"class.std::__shared_ptr.11" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.18" = type { %"class.std::__shared_ptr.19" }
%"class.std::__shared_ptr.19" = type { ptr, %"class.std::__shared_count" }
%"class.__gnu_cxx::__normal_iterator.22" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.21" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12RequestBatchC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18SortMergeScheduler12executeBatchESt10shared_ptrI14PhysicalReaderE12RequestBatchSt6vectorIS0_I10ByteBufferESaIS6_EEl(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef %3, ptr noundef %4, i64 noundef %5) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca ptr, align 8
  %8 = alloca ptr, align 8
  %9 = alloca ptr, align 8
  %10 = alloca ptr, align 8
  %11 = alloca ptr, align 8
  %12 = alloca i64, align 8
  %13 = alloca %"class.std::vector.5", align 8
  %14 = alloca %class.RequestBatch, align 8
  %15 = alloca ptr, align 8
  %16 = alloca i32, align 4
  %17 = alloca i1, align 1
  %18 = alloca ptr, align 8
  %19 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %20 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %21 = alloca %"class.std::shared_ptr.10", align 8
  %22 = alloca %"class.std::shared_ptr.18", align 8
  %23 = alloca %"class.std::vector", align 8
  %24 = alloca %"class.std::shared_ptr.18", align 8
  %25 = alloca %"class.__gnu_cxx::__normal_iterator.22", align 8
  %26 = alloca %"class.__gnu_cxx::__normal_iterator.21", align 8
  %27 = alloca %"class.__gnu_cxx::__normal_iterator.21", align 8
  %28 = alloca %"class.__gnu_cxx::__normal_iterator.21", align 8
  %29 = alloca %"class.__gnu_cxx::__normal_iterator.21", align 8
  store ptr %0, ptr %7, align 8
  store ptr %1, ptr %8, align 8, !tbaa !5
  store ptr %2, ptr %9, align 8, !tbaa !5
  store ptr %3, ptr %10, align 8, !tbaa !5
  store ptr %4, ptr %11, align 8, !tbaa !5
  store i64 %5, ptr %12, align 8, !tbaa !9
  %30 = load ptr, ptr %8, align 8
  %31 = call noundef i32 @_ZN12RequestBatch7getSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %32 = icmp slt i32 %31, 0
  br i1 %32, label %33, label %34

33:                                               ; preds = %6
  call void @llvm.memset.p0.i64(ptr align 8 %0, i8 0, i64 24, i1 false)
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %111

34:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 24, ptr %13) #7
  call void @_ZN12RequestBatchC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %14, ptr noundef nonnull align 8 dereferenceable(32) %3)
  %35 = load i64, ptr %12, align 8, !tbaa !9
  invoke void @_ZN18SortMergeScheduler9sortMergeE12RequestBatchl(ptr dead_on_unwind writable sret(%"class.std::vector.5") align 8 %13, ptr noundef nonnull align 8 dereferenceable(8) %30, ptr noundef %14, i64 noundef %35)
          to label %36 unwind label %46

36:                                               ; preds = %34
  call void @_ZN12RequestBatchD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  store i1 false, ptr %17, align 1
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %18) #7
  store ptr %13, ptr %18, align 8, !tbaa !5
  call void @llvm.lifetime.start.p0(i64 8, ptr %19) #7
  %37 = load ptr, ptr %18, align 8, !tbaa !5
  %38 = call ptr @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %37) #7
  %39 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %19, i32 0, i32 0
  store ptr %38, ptr %39, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr %20) #7
  %40 = load ptr, ptr %18, align 8, !tbaa !5
  %41 = call ptr @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %40) #7
  %42 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator", ptr %20, i32 0, i32 0
  store ptr %41, ptr %42, align 8
  br label %43

43:                                               ; preds = %85, %36
  %44 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt10shared_ptrI13MergedRequestESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %19, ptr noundef nonnull align 8 dereferenceable(8) %20) #7
  br i1 %44, label %50, label %45

45:                                               ; preds = %43
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  br label %106

46:                                               ; preds = %34
  %47 = landingpad { ptr, i32 }
          cleanup
  %48 = extractvalue { ptr, i32 } %47, 0
  store ptr %48, ptr %15, align 8
  %49 = extractvalue { ptr, i32 } %47, 1
  store i32 %49, ptr %16, align 4
  call void @_ZN12RequestBatchD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %14) #7
  br label %110

50:                                               ; preds = %43
  call void @llvm.lifetime.start.p0(i64 16, ptr %21) #7
  %51 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt10shared_ptrI13MergedRequestESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  call void @_ZNSt10shared_ptrI13MergedRequestEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %21, ptr noundef nonnull align 8 dereferenceable(16) %51) #7
  %52 = call noundef ptr @_ZNKSt19__shared_ptr_accessI14PhysicalReaderLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  %53 = call noundef ptr @_ZNKSt19__shared_ptr_accessI13MergedRequestLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  %54 = invoke noundef i64 @_ZN13MergedRequest8getStartEv(ptr noundef nonnull align 8 dereferenceable(104) %53)
          to label %55 unwind label %87

55:                                               ; preds = %50
  %56 = load ptr, ptr %52, align 8, !tbaa !11
  %57 = getelementptr inbounds ptr, ptr %56, i64 1
  %58 = load ptr, ptr %57, align 8
  invoke void %58(ptr noundef nonnull align 8 dereferenceable(8) %52, i64 noundef %54)
          to label %59 unwind label %87

59:                                               ; preds = %55
  call void @llvm.lifetime.start.p0(i64 16, ptr %22) #7
  %60 = call noundef ptr @_ZNKSt19__shared_ptr_accessI14PhysicalReaderLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  %61 = call noundef ptr @_ZNKSt19__shared_ptr_accessI13MergedRequestLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  %62 = invoke noundef i32 @_ZN13MergedRequest9getLengthEv(ptr noundef nonnull align 8 dereferenceable(104) %61)
          to label %63 unwind label %91

63:                                               ; preds = %59
  %64 = load ptr, ptr %60, align 8, !tbaa !11
  %65 = getelementptr inbounds ptr, ptr %64, i64 2
  %66 = load ptr, ptr %65, align 8
  invoke void %66(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.18") align 8 %22, ptr noundef nonnull align 8 dereferenceable(8) %60, i32 noundef %62)
          to label %67 unwind label %91

67:                                               ; preds = %63
  call void @llvm.lifetime.start.p0(i64 24, ptr %23) #7
  %68 = call noundef ptr @_ZNKSt19__shared_ptr_accessI13MergedRequestLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %21) #7
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %24, ptr noundef nonnull align 8 dereferenceable(16) %22) #7
  invoke void @_ZN13MergedRequest8completeESt10shared_ptrI10ByteBufferE(ptr dead_on_unwind writable sret(%"class.std::vector") align 8 %23, ptr noundef nonnull align 8 dereferenceable(104) %68, ptr noundef %24)
          to label %69 unwind label %95

69:                                               ; preds = %67
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr %26) #7
  %70 = call ptr @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  %71 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.21", ptr %26, i32 0, i32 0
  store ptr %70, ptr %71, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrI10ByteBufferESt6vectorIS3_SaIS3_EEEC2IPS3_vEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %25, ptr noundef nonnull align 8 dereferenceable(8) %26) #7
  %72 = call ptr @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  %73 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.21", ptr %27, i32 0, i32 0
  store ptr %72, ptr %73, align 8
  %74 = call ptr @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  %75 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.21", ptr %28, i32 0, i32 0
  store ptr %74, ptr %75, align 8
  %76 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.22", ptr %25, i32 0, i32 0
  %77 = load ptr, ptr %76, align 8
  %78 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.21", ptr %27, i32 0, i32 0
  %79 = load ptr, ptr %78, align 8
  %80 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.21", ptr %28, i32 0, i32 0
  %81 = load ptr, ptr %80, align 8
  %82 = invoke ptr @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EE6insertIN9__gnu_cxx17__normal_iteratorIPS2_S4_EEvEES9_NS7_IPKS2_S4_EET_SD_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %77, ptr %79, ptr %81)
          to label %83 unwind label %99

83:                                               ; preds = %69
  %84 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.21", ptr %29, i32 0, i32 0
  store ptr %82, ptr %84, align 8
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #7
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  br label %85

85:                                               ; preds = %83
  %86 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt10shared_ptrI13MergedRequestESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %19) #7
  br label %43

87:                                               ; preds = %55, %50
  %88 = landingpad { ptr, i32 }
          cleanup
  %89 = extractvalue { ptr, i32 } %88, 0
  store ptr %89, ptr %15, align 8
  %90 = extractvalue { ptr, i32 } %88, 1
  store i32 %90, ptr %16, align 4
  br label %105

91:                                               ; preds = %63, %59
  %92 = landingpad { ptr, i32 }
          cleanup
  %93 = extractvalue { ptr, i32 } %92, 0
  store ptr %93, ptr %15, align 8
  %94 = extractvalue { ptr, i32 } %92, 1
  store i32 %94, ptr %16, align 4
  br label %104

95:                                               ; preds = %67
  %96 = landingpad { ptr, i32 }
          cleanup
  %97 = extractvalue { ptr, i32 } %96, 0
  store ptr %97, ptr %15, align 8
  %98 = extractvalue { ptr, i32 } %96, 1
  store i32 %98, ptr %16, align 4
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %24) #7
  br label %103

99:                                               ; preds = %69
  %100 = landingpad { ptr, i32 }
          cleanup
  %101 = extractvalue { ptr, i32 } %100, 0
  store ptr %101, ptr %15, align 8
  %102 = extractvalue { ptr, i32 } %100, 1
  store i32 %102, ptr %16, align 4
  call void @llvm.lifetime.end.p0(i64 8, ptr %26) #7
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %23) #7
  br label %103

103:                                              ; preds = %99, %95
  call void @llvm.lifetime.end.p0(i64 24, ptr %23) #7
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %22) #7
  br label %104

104:                                              ; preds = %103, %91
  call void @llvm.lifetime.end.p0(i64 16, ptr %22) #7
  br label %105

105:                                              ; preds = %104, %87
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %21) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %21) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %20) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %19) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr %18) #7
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  call void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  br label %110

106:                                              ; preds = %45
  store i1 true, ptr %17, align 1
  %107 = load i1, ptr %17, align 1
  br i1 %107, label %109, label %108

108:                                              ; preds = %106
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %109

109:                                              ; preds = %108, %106
  call void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  br label %111

110:                                              ; preds = %105, %46
  call void @llvm.lifetime.end.p0(i64 24, ptr %13) #7
  br label %112

111:                                              ; preds = %109, %33
  ret void

112:                                              ; preds = %110
  %113 = load ptr, ptr %15, align 8
  %114 = load i32, ptr %16, align 4
  %115 = insertvalue { ptr, i32 } poison, ptr %113, 0
  %116 = insertvalue { ptr, i32 } %115, i32 %114, 1
  resume { ptr, i32 } %116
}

declare noundef i32 @_ZN12RequestBatch7getSizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18SortMergeScheduler9sortMergeE12RequestBatchl(ptr dead_on_unwind noalias writable sret(%"class.std::vector.5") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64 noundef) #4 align 2

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

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

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

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

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

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

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

declare noundef i64 @_ZN13MergedRequest8getStartEv(ptr noundef nonnull align 8 dereferenceable(104)) #5

declare noundef i32 @_ZN13MergedRequest9getLengthEv(ptr noundef nonnull align 8 dereferenceable(104)) #5

declare void @_ZN13MergedRequest8completeESt10shared_ptrI10ByteBufferE(ptr dead_on_unwind writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) #5

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

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

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

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

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

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 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 = { nocallback nofree nounwind willreturn memory(argmem: write) }
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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }

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

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


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

%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<std::shared_ptr<ByteBuffer>, std::allocator<std::shared_ptr<ByteBuffer>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<ByteBuffer>, std::allocator<std::shared_ptr<ByteBuffer>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<ByteBuffer>, std::allocator<std::shared_ptr<ByteBuffer>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<ByteBuffer>, std::allocator<std::shared_ptr<ByteBuffer>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.std::vector.5" = type { %"struct.std::_Vector_base.6" }
%"struct.std::_Vector_base.6" = type { %"struct.std::_Vector_base<std::shared_ptr<MergedRequest>, std::allocator<std::shared_ptr<MergedRequest>>>::_Vector_impl" }
%"struct.std::_Vector_base<std::shared_ptr<MergedRequest>, std::allocator<std::shared_ptr<MergedRequest>>>::_Vector_impl" = type { %"struct.std::_Vector_base<std::shared_ptr<MergedRequest>, std::allocator<std::shared_ptr<MergedRequest>>>::_Vector_impl_data" }
%"struct.std::_Vector_base<std::shared_ptr<MergedRequest>, std::allocator<std::shared_ptr<MergedRequest>>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%class.RequestBatch = type { i32, %"class.std::vector.0" }
%"class.std::vector.0" = type { %"struct.std::_Vector_base.1" }
%"struct.std::_Vector_base.1" = type { %"struct.std::_Vector_base<Request, std::allocator<Request>>::_Vector_impl" }
%"struct.std::_Vector_base<Request, std::allocator<Request>>::_Vector_impl" = type { %"struct.std::_Vector_base<Request, std::allocator<Request>>::_Vector_impl_data" }
%"struct.std::_Vector_base<Request, std::allocator<Request>>::_Vector_impl_data" = type { ptr, ptr, ptr }
%"class.__gnu_cxx::__normal_iterator" = type { ptr }
%"class.std::shared_ptr.10" = type { %"class.std::__shared_ptr.11" }
%"class.std::__shared_ptr.11" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%"class.std::shared_ptr.18" = type { %"class.std::__shared_ptr.19" }
%"class.std::__shared_ptr.19" = type { ptr, %"class.std::__shared_count" }
%"class.__gnu_cxx::__normal_iterator.22" = type { ptr }
%"class.__gnu_cxx::__normal_iterator.21" = type { ptr }

declare i32 @__gxx_personality_v0(...)

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZN12RequestBatchC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32), ptr noundef nonnull align 8 dereferenceable(32)) unnamed_addr #0 align 2

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

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

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

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

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN18SortMergeScheduler12executeBatchESt10shared_ptrI14PhysicalReaderE12RequestBatchSt6vectorIS0_I10ByteBufferESaIS6_EEl(ptr dead_on_unwind noalias writable sret(%"class.std::vector") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, ptr noundef nonnull %3, ptr nocapture noundef readnone %4, i64 noundef %5) unnamed_addr #4 align 2 personality ptr @__gxx_personality_v0 {
  %7 = alloca %"class.std::vector.5", align 8
  %8 = alloca %class.RequestBatch, align 8
  %9 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator", align 8
  %11 = alloca %"class.std::shared_ptr.10", align 8
  %12 = alloca %"class.std::shared_ptr.18", align 8
  %13 = alloca %"class.std::vector", align 8
  %14 = alloca %"class.std::shared_ptr.18", align 8
  %15 = alloca %"class.__gnu_cxx::__normal_iterator.22", align 8
  %16 = alloca %"class.__gnu_cxx::__normal_iterator.21", align 8
  %17 = tail call noundef i32 @_ZN12RequestBatch7getSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %3)
  %18 = icmp slt i32 %17, 0
  br i1 %18, label %19, label %20

19:                                               ; preds = %6
  tail call void @llvm.memset.p0.i64(ptr noundef nonnull align 8 dereferenceable(24) %0, i8 0, i64 24, i1 false)
  tail call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %66

20:                                               ; preds = %6
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %7) #7
  call void @_ZN12RequestBatchC2ERKS_(ptr noundef nonnull align 8 dereferenceable(32) %8, ptr noundef nonnull align 8 dereferenceable(32) %3)
  invoke void @_ZN18SortMergeScheduler9sortMergeE12RequestBatchl(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.5") align 8 %7, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef nonnull %8, i64 noundef %5)
          to label %21 unwind label %25

21:                                               ; preds = %20
  call void @_ZN12RequestBatchD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %9) #7
  %22 = call ptr @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  store ptr %22, ptr %9, align 8
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %10) #7
  %23 = call ptr @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  store ptr %23, ptr %10, align 8
  %24 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt10shared_ptrI13MergedRequestESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %24, label %.lr.ph, label %._crit_edge

._crit_edge:                                      ; preds = %51, %21
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  br label %66

25:                                               ; preds = %20
  %26 = landingpad { ptr, i32 }
          cleanup
  call void @_ZN12RequestBatchD2Ev(ptr noundef nonnull align 8 dereferenceable(32) %8) #7
  br label %65

.lr.ph:                                           ; preds = %21, %51
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %11) #7
  %27 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNK9__gnu_cxx17__normal_iteratorIPSt10shared_ptrI13MergedRequestESt6vectorIS3_SaIS3_EEEdeEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  call void @_ZNSt10shared_ptrI13MergedRequestEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %11, ptr noundef nonnull align 8 dereferenceable(16) %27) #7
  %28 = call noundef ptr @_ZNKSt19__shared_ptr_accessI14PhysicalReaderLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  %29 = call noundef ptr @_ZNKSt19__shared_ptr_accessI13MergedRequestLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  %30 = invoke noundef i64 @_ZN13MergedRequest8getStartEv(ptr noundef nonnull align 8 dereferenceable(104) %29)
          to label %31 unwind label %54

31:                                               ; preds = %.lr.ph
  %32 = load ptr, ptr %28, align 8, !tbaa !5
  %33 = getelementptr inbounds i8, ptr %32, i64 8
  %34 = load ptr, ptr %33, align 8
  invoke void %34(ptr noundef nonnull align 8 dereferenceable(8) %28, i64 noundef %30)
          to label %35 unwind label %54

35:                                               ; preds = %31
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %12) #7
  %36 = call noundef ptr @_ZNKSt19__shared_ptr_accessI14PhysicalReaderLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %2) #7
  %37 = call noundef ptr @_ZNKSt19__shared_ptr_accessI13MergedRequestLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  %38 = invoke noundef i32 @_ZN13MergedRequest9getLengthEv(ptr noundef nonnull align 8 dereferenceable(104) %37)
          to label %39 unwind label %56

39:                                               ; preds = %35
  %40 = load ptr, ptr %36, align 8, !tbaa !5
  %41 = getelementptr inbounds i8, ptr %40, i64 16
  %42 = load ptr, ptr %41, align 8
  invoke void %42(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.18") align 8 %12, ptr noundef nonnull align 8 dereferenceable(8) %36, i32 noundef %38)
          to label %43 unwind label %56

43:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %13) #7
  %44 = call noundef ptr @_ZNKSt19__shared_ptr_accessI13MergedRequestLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %11) #7
  call void @_ZNSt10shared_ptrI10ByteBufferEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %14, ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  invoke void @_ZN13MergedRequest8completeESt10shared_ptrI10ByteBufferE(ptr dead_on_unwind nonnull writable sret(%"class.std::vector") align 8 %13, ptr noundef nonnull align 8 dereferenceable(104) %44, ptr noundef nonnull %14)
          to label %45 unwind label %58

45:                                               ; preds = %43
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  call void @llvm.lifetime.start.p0(i64 8, ptr nonnull %16) #7
  %46 = call ptr @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  store ptr %46, ptr %16, align 8
  call void @_ZN9__gnu_cxx17__normal_iteratorIPKSt10shared_ptrI10ByteBufferESt6vectorIS3_SaIS3_EEEC2IPS3_vEERKNS0_IT_S8_EE(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull align 8 dereferenceable(8) %16) #7
  %47 = call ptr @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  %48 = call ptr @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  %49 = load ptr, ptr %15, align 8
  %50 = invoke ptr @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EE6insertIN9__gnu_cxx17__normal_iteratorIPS2_S4_EEvEES9_NS7_IPKS2_S4_EET_SD_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr %49, ptr %47, ptr %48)
          to label %51 unwind label %60

51:                                               ; preds = %45
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  %52 = call noundef nonnull align 8 dereferenceable(8) ptr @_ZN9__gnu_cxx17__normal_iteratorIPSt10shared_ptrI13MergedRequestESt6vectorIS3_SaIS3_EEEppEv(ptr noundef nonnull align 8 dereferenceable(8) %9) #7
  %53 = call noundef zeroext i1 @_ZN9__gnu_cxxneIPSt10shared_ptrI13MergedRequestESt6vectorIS3_SaIS3_EEEEbRKNS_17__normal_iteratorIT_T0_EESD_(ptr noundef nonnull align 8 dereferenceable(8) %9, ptr noundef nonnull align 8 dereferenceable(8) %10) #7
  br i1 %53, label %.lr.ph, label %._crit_edge

54:                                               ; preds = %31, %.lr.ph
  %55 = landingpad { ptr, i32 }
          cleanup
  br label %64

56:                                               ; preds = %39, %35
  %57 = landingpad { ptr, i32 }
          cleanup
  br label %63

58:                                               ; preds = %43
  %59 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %14) #7
  br label %62

60:                                               ; preds = %45
  %61 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %16) #7
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %13) #7
  br label %62

62:                                               ; preds = %60, %58
  %.pn = phi { ptr, i32 } [ %61, %60 ], [ %59, %58 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %13) #7
  call void @_ZNSt12__shared_ptrI10ByteBufferLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %12) #7
  br label %63

63:                                               ; preds = %62, %56
  %.pn.pn = phi { ptr, i32 } [ %.pn, %62 ], [ %57, %56 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %12) #7
  br label %64

64:                                               ; preds = %63, %54
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %63 ], [ %55, %54 ]
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %11) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %11) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %10) #7
  call void @llvm.lifetime.end.p0(i64 8, ptr nonnull %9) #7
  call void @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  call void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %7) #7
  br label %65

65:                                               ; preds = %64, %25
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %64 ], [ %26, %25 ]
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %7) #7
  resume { ptr, i32 } %.pn.pn.pn.pn

66:                                               ; preds = %._crit_edge, %19
  ret void
}

declare noundef i32 @_ZN12RequestBatch7getSizeEv(ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZN18SortMergeScheduler9sortMergeE12RequestBatchl(ptr dead_on_unwind noalias writable sret(%"class.std::vector.5") align 8, ptr noundef nonnull align 8 dereferenceable(8), ptr noundef, i64 noundef) local_unnamed_addr #4 align 2

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

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

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

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

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

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

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

declare noundef i64 @_ZN13MergedRequest8getStartEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #5

declare noundef i32 @_ZN13MergedRequest9getLengthEv(ptr noundef nonnull align 8 dereferenceable(104)) local_unnamed_addr #5

declare void @_ZN13MergedRequest8completeESt10shared_ptrI10ByteBufferE(ptr dead_on_unwind writable sret(%"class.std::vector") align 8, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef) local_unnamed_addr #5

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

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local ptr @_ZNSt6vectorISt10shared_ptrI10ByteBufferESaIS2_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24)) 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) #6

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

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

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

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16)) unnamed_addr #2 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 nocallback nofree nounwind willreturn memory(argmem: write) }
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 nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #4 = { mustprogress uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { "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 = { mustprogress nocallback nofree nosync nounwind willreturn memory(argmem: readwrite) }
attributes #7 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"vtable pointer", !7, i64 0}
!7 = !{!"Simple C++ TBAA"}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,IPSCCPPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,LoopRotatePass,LoopSimplifyPass,LoopUnrollPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass,TailCallElimPass