; 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.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.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.23" = type { ptr }
%class.anon = type { i8 }
%"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.Request = type { i64, i64, i64, i64 }

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_ZN12RequestBatch7getSizeEv(ptr noundef nonnull align 8 dereferenceable(32)) #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 uwtable
define dso_local void @_ZN18SortMergeScheduler9sortMergeE12RequestBatchl(ptr dead_on_unwind noalias writable sret(%"class.std::vector.5") align 8 %0, ptr noundef nonnull align 8 dereferenceable(8) %1, ptr noundef %2, i64 noundef %3) #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca ptr, align 8
  %6 = alloca ptr, align 8
  %7 = alloca ptr, align 8
  %8 = alloca i64, align 8
  %9 = alloca %"class.std::vector.0", align 8
  %10 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %11 = alloca %"class.__gnu_cxx::__normal_iterator.23", align 8
  %12 = alloca %class.anon, align 1
  %13 = alloca ptr, align 8
  %14 = alloca i32, align 4
  %15 = alloca i1, align 1
  %16 = alloca %"class.std::shared_ptr.10", align 8
  %17 = alloca %"class.std::shared_ptr.10", align 8
  %18 = alloca i32, align 4
  %19 = alloca %"class.std::shared_ptr.10", align 8
  %20 = alloca %class.Request, align 8
  store ptr %0, ptr %5, align 8
  store ptr %1, ptr %6, align 8, !tbaa !5
  store ptr %2, ptr %7, align 8, !tbaa !5
  store i64 %3, ptr %8, align 8, !tbaa !9
  %21 = load ptr, ptr %6, align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr %9) #7
  call void @_ZN12RequestBatch11getRequestsEv(ptr dead_on_unwind writable sret(%"class.std::vector.0") align 8 %9, ptr noundef nonnull align 8 dereferenceable(32) %2)
  %22 = call ptr @_ZNSt6vectorI7RequestSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %23 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.23", ptr %10, i32 0, i32 0
  store ptr %22, ptr %23, align 8
  %24 = call ptr @_ZNSt6vectorI7RequestSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  %25 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.23", ptr %11, i32 0, i32 0
  store ptr %24, ptr %25, align 8
  %26 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.23", ptr %10, i32 0, i32 0
  %27 = load ptr, ptr %26, align 8
  %28 = getelementptr inbounds %"class.__gnu_cxx::__normal_iterator.23", ptr %11, i32 0, i32 0
  %29 = load ptr, ptr %28, align 8
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP7RequestSt6vectorIS2_SaIS2_EEEEZN18SortMergeScheduler9sortMergeE12RequestBatchlE3$_0EvT_SB_T0_"(ptr %27, ptr %29)
          to label %30 unwind label %40

30:                                               ; preds = %4
  store i1 false, ptr %15, align 1
  call void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  call void @llvm.lifetime.start.p0(i64 16, ptr %16) #7
  %31 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI7RequestSaIS0_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef 0)
          to label %32 unwind label %44

32:                                               ; preds = %30
  invoke void @_ZSt11make_sharedI13MergedRequestJR7RequestEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.10") align 8 %16, ptr noundef nonnull align 8 dereferenceable(32) %31)
          to label %33 unwind label %44

33:                                               ; preds = %32
  call void @llvm.lifetime.start.p0(i64 16, ptr %17) #7
  call void @_ZNSt10shared_ptrI13MergedRequestEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %16) #7
  call void @llvm.lifetime.start.p0(i64 4, ptr %18) #7
  store i32 1, ptr %18, align 4, !tbaa !11
  br label %34

34:                                               ; preds = %70, %33
  %35 = load i32, ptr %18, align 4, !tbaa !11
  %36 = invoke noundef i32 @_ZN12RequestBatch7getSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %37 unwind label %48

37:                                               ; preds = %34
  %38 = icmp slt i32 %35, %36
  br i1 %38, label %52, label %39

39:                                               ; preds = %37
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %74

40:                                               ; preds = %4
  %41 = landingpad { ptr, i32 }
          cleanup
  %42 = extractvalue { ptr, i32 } %41, 0
  store ptr %42, ptr %13, align 8
  %43 = extractvalue { ptr, i32 } %41, 1
  store i32 %43, ptr %14, align 4
  br label %86

44:                                               ; preds = %32, %30
  %45 = landingpad { ptr, i32 }
          cleanup
  %46 = extractvalue { ptr, i32 } %45, 0
  store ptr %46, ptr %13, align 8
  %47 = extractvalue { ptr, i32 } %45, 1
  store i32 %47, ptr %14, align 4
  br label %83

48:                                               ; preds = %66, %34
  %49 = landingpad { ptr, i32 }
          cleanup
  %50 = extractvalue { ptr, i32 } %49, 0
  store ptr %50, ptr %13, align 8
  %51 = extractvalue { ptr, i32 } %49, 1
  store i32 %51, ptr %14, align 4
  br label %73

52:                                               ; preds = %37
  call void @llvm.lifetime.start.p0(i64 16, ptr %19) #7
  %53 = call noundef ptr @_ZNKSt19__shared_ptr_accessI13MergedRequestLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %16) #7
  %54 = load i32, ptr %18, align 4, !tbaa !11
  %55 = sext i32 %54 to i64
  %56 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI7RequestSaIS0_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %9, i64 noundef %55)
          to label %57 unwind label %62

57:                                               ; preds = %52
  call void @llvm.memcpy.p0.p0.i64(ptr align 8 %20, ptr align 8 %56, i64 32, i1 false), !tbaa.struct !13
  invoke void @_ZN13MergedRequest5mergeE7Request(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.10") align 8 %19, ptr noundef nonnull align 8 dereferenceable(104) %53, ptr noundef byval(%class.Request) align 8 %20)
          to label %58 unwind label %62

58:                                               ; preds = %57
  %59 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI13MergedRequestEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16) %17, ptr noundef nonnull align 8 dereferenceable(16) %19) #7
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %19) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  %60 = call noundef zeroext i1 @_ZSteqI13MergedRequestS0_EbRKSt10shared_ptrIT_ERKS1_IT0_E(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %17) #7
  br i1 %60, label %61, label %66

61:                                               ; preds = %58
  br label %70

62:                                               ; preds = %57, %52
  %63 = landingpad { ptr, i32 }
          cleanup
  %64 = extractvalue { ptr, i32 } %63, 0
  store ptr %64, ptr %13, align 8
  %65 = extractvalue { ptr, i32 } %63, 1
  store i32 %65, ptr %14, align 4
  call void @llvm.lifetime.end.p0(i64 16, ptr %19) #7
  br label %73

66:                                               ; preds = %58
  %67 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EE12emplace_backIJRS2_EEES6_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %16)
          to label %68 unwind label %48

68:                                               ; preds = %66
  %69 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI13MergedRequestEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %16, ptr noundef nonnull align 8 dereferenceable(16) %17) #7
  br label %70

70:                                               ; preds = %68, %61
  %71 = load i32, ptr %18, align 4, !tbaa !11
  %72 = add nsw i32 %71, 1
  store i32 %72, ptr %18, align 4, !tbaa !11
  br label %34, !llvm.loop !14

73:                                               ; preds = %62, %48
  call void @llvm.lifetime.end.p0(i64 4, ptr %18) #7
  br label %82

74:                                               ; preds = %39
  %75 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EE12emplace_backIJRS2_EEES6_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %17)
          to label %76 unwind label %78

76:                                               ; preds = %74
  store i1 true, ptr %15, align 1
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  %77 = load i1, ptr %15, align 1
  br i1 %77, label %85, label %84

78:                                               ; preds = %74
  %79 = landingpad { ptr, i32 }
          cleanup
  %80 = extractvalue { ptr, i32 } %79, 0
  store ptr %80, ptr %13, align 8
  %81 = extractvalue { ptr, i32 } %79, 1
  store i32 %81, ptr %14, align 4
  br label %82

82:                                               ; preds = %78, %73
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %17) #7
  call void @llvm.lifetime.end.p0(i64 16, ptr %17) #7
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %16) #7
  br label %83

83:                                               ; preds = %82, %44
  call void @llvm.lifetime.end.p0(i64 16, ptr %16) #7
  call void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %86

84:                                               ; preds = %76
  call void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #7
  br label %85

85:                                               ; preds = %84, %76
  call void @_ZNSt6vectorI7RequestSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  ret void

86:                                               ; preds = %83, %40
  call void @_ZNSt6vectorI7RequestSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %9) #7
  call void @llvm.lifetime.end.p0(i64 24, ptr %9) #7
  br label %87

87:                                               ; preds = %86
  %88 = load ptr, ptr %13, align 8
  %89 = load i32, ptr %14, align 4
  %90 = insertvalue { ptr, i32 } poison, ptr %88, 0
  %91 = insertvalue { ptr, i32 } %90, i32 %89, 1
  resume { ptr, i32 } %91
}

; 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 #3 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)) #3 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

declare void @_ZN12RequestBatch11getRequestsEv(ptr dead_on_unwind writable sret(%"class.std::vector.0") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #0

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP7RequestSt6vectorIS2_SaIS2_EEEEZN18SortMergeScheduler9sortMergeE12RequestBatchlE3$_0EvT_SB_T0_"(ptr, ptr) #4

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedI13MergedRequestJR7RequestEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.10") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #4

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

declare void @_ZN13MergedRequest5mergeE7Request(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.10") align 8, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef byval(%class.Request) align 8) #0

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

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

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

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

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

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

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

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = !{!6, !6, i64 0}
!6 = !{!"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 = !{!"int", !7, i64 0}
!13 = !{i64 0, i64 8, !9, i64 8, i64 8, !9, i64 16, i64 8, !9, i64 24, i64 8, !9}
!14 = distinct !{!14, !15}
!15 = !{!"llvm.loop.mustprogress"}


; 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.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.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.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.Request = type { i64, i64, i64, i64 }

declare i32 @__gxx_personality_v0(...)

declare noundef i32 @_ZN12RequestBatch7getSizeEv(ptr noundef nonnull align 8 dereferenceable(32)) 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 uwtable
define dso_local void @_ZN18SortMergeScheduler9sortMergeE12RequestBatchl(ptr dead_on_unwind noalias writable sret(%"class.std::vector.5") align 8 %0, ptr nocapture noundef nonnull readnone align 8 dereferenceable(8) %1, ptr noundef nonnull %2, i64 noundef %3) local_unnamed_addr #2 align 2 personality ptr @__gxx_personality_v0 {
  %5 = alloca %"class.std::vector.0", align 8
  %6 = alloca %"class.std::shared_ptr.10", align 8
  %7 = alloca %"class.std::shared_ptr.10", align 8
  %8 = alloca %"class.std::shared_ptr.10", align 8
  call void @llvm.lifetime.start.p0(i64 24, ptr nonnull %5) #6
  call void @_ZN12RequestBatch11getRequestsEv(ptr dead_on_unwind nonnull writable sret(%"class.std::vector.0") align 8 %5, ptr noundef nonnull align 8 dereferenceable(32) %2)
  %9 = call ptr @_ZNSt6vectorI7RequestSaIS0_EE5beginEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  %10 = call ptr @_ZNSt6vectorI7RequestSaIS0_EE3endEv(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  invoke void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP7RequestSt6vectorIS2_SaIS2_EEEEZN18SortMergeScheduler9sortMergeE12RequestBatchlE3$_0EvT_SB_T0_"(ptr %9, ptr %10)
          to label %11 unwind label %22

11:                                               ; preds = %4
  call void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EEC2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %6) #6
  %12 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI7RequestSaIS0_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef 0)
          to label %13 unwind label %24

13:                                               ; preds = %11
  invoke void @_ZSt11make_sharedI13MergedRequestJR7RequestEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.10") align 8 %6, ptr noundef nonnull align 8 dereferenceable(32) %12)
          to label %14 unwind label %24

14:                                               ; preds = %13
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %7) #6
  call void @_ZNSt10shared_ptrI13MergedRequestEC2ERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  br label %15

15:                                               ; preds = %41, %14
  %indvars.iv = phi i64 [ %indvars.iv.next, %41 ], [ 1, %14 ]
  %16 = invoke noundef i32 @_ZN12RequestBatch7getSizeEv(ptr noundef nonnull align 8 dereferenceable(32) %2)
          to label %17 unwind label %26

17:                                               ; preds = %15
  %18 = sext i32 %16 to i64
  %19 = icmp slt i64 %indvars.iv, %18
  br i1 %19, label %28, label %20

20:                                               ; preds = %17
  %21 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EE12emplace_backIJRS2_EEES6_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %7)
          to label %42 unwind label %43

22:                                               ; preds = %4
  %23 = landingpad { ptr, i32 }
          cleanup
  br label %47

24:                                               ; preds = %13, %11
  %25 = landingpad { ptr, i32 }
          cleanup
  br label %46

26:                                               ; preds = %37, %15
  %27 = landingpad { ptr, i32 }
          cleanup
  br label %45

28:                                               ; preds = %17
  call void @llvm.lifetime.start.p0(i64 16, ptr nonnull %8) #6
  %29 = call noundef ptr @_ZNKSt19__shared_ptr_accessI13MergedRequestLN9__gnu_cxx12_Lock_policyE2ELb0ELb0EEptEv(ptr noundef nonnull align 1 dereferenceable(1) %6) #6
  %30 = invoke noundef nonnull align 8 dereferenceable(32) ptr @_ZNSt6vectorI7RequestSaIS0_EE2atEm(ptr noundef nonnull align 8 dereferenceable(24) %5, i64 noundef %indvars.iv)
          to label %31 unwind label %35

31:                                               ; preds = %28
  invoke void @_ZN13MergedRequest5mergeE7Request(ptr dead_on_unwind nonnull writable sret(%"class.std::shared_ptr.10") align 8 %8, ptr noundef nonnull align 8 dereferenceable(104) %29, ptr noundef nonnull byval(%class.Request) align 8 %30)
          to label %32 unwind label %35

32:                                               ; preds = %31
  %33 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI13MergedRequestEaSEOS1_(ptr noundef nonnull align 8 dereferenceable(16) %7, ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %8) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  %34 = call noundef zeroext i1 @_ZSteqI13MergedRequestS0_EbRKSt10shared_ptrIT_ERKS1_IT0_E(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  br i1 %34, label %41, label %37

35:                                               ; preds = %31, %28
  %36 = landingpad { ptr, i32 }
          cleanup
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %8) #6
  br label %45

37:                                               ; preds = %32
  %38 = invoke noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EE12emplace_backIJRS2_EEES6_DpOT_(ptr noundef nonnull align 8 dereferenceable(24) %0, ptr noundef nonnull align 8 dereferenceable(16) %6)
          to label %39 unwind label %26

39:                                               ; preds = %37
  %40 = call noundef nonnull align 8 dereferenceable(16) ptr @_ZNSt10shared_ptrI13MergedRequestEaSERKS1_(ptr noundef nonnull align 8 dereferenceable(16) %6, ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  br label %41

41:                                               ; preds = %32, %39
  %indvars.iv.next = add nuw nsw i64 %indvars.iv, 1
  br label %15, !llvm.loop !5

42:                                               ; preds = %20
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @_ZNSt6vectorI7RequestSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  ret void

43:                                               ; preds = %20
  %44 = landingpad { ptr, i32 }
          cleanup
  br label %45

45:                                               ; preds = %26, %35, %43
  %.pn.pn = phi { ptr, i32 } [ %44, %43 ], [ %27, %26 ], [ %36, %35 ]
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %7) #6
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %7) #6
  call void @_ZNSt12__shared_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EED2Ev(ptr noundef nonnull align 8 dereferenceable(16) %6) #6
  br label %46

46:                                               ; preds = %45, %24
  %.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn, %45 ], [ %25, %24 ]
  call void @llvm.lifetime.end.p0(i64 16, ptr nonnull %6) #6
  call void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %0) #6
  br label %47

47:                                               ; preds = %46, %22
  %.pn.pn.pn.pn = phi { ptr, i32 } [ %.pn.pn.pn, %46 ], [ %23, %22 ]
  call void @_ZNSt6vectorI7RequestSaIS0_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24) %5) #6
  call void @llvm.lifetime.end.p0(i64 24, ptr nonnull %5) #6
  resume { ptr, i32 } %.pn.pn.pn.pn
}

; 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 #3 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 #3 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 nounwind uwtable
declare dso_local void @_ZNSt6vectorISt10shared_ptrI13MergedRequestESaIS2_EED2Ev(ptr noundef nonnull align 8 dereferenceable(24)) unnamed_addr #3 align 2

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

; Function Attrs: inlinehint mustprogress uwtable
declare hidden void @"_ZSt4sortIN9__gnu_cxx17__normal_iteratorIP7RequestSt6vectorIS2_SaIS2_EEEEZN18SortMergeScheduler9sortMergeE12RequestBatchlE3$_0EvT_SB_T0_"(ptr, ptr) local_unnamed_addr #4

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

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

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

; Function Attrs: inlinehint mustprogress uwtable
declare dso_local void @_ZSt11make_sharedI13MergedRequestJR7RequestEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr.10") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #4

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

declare void @_ZN13MergedRequest5mergeE7Request(ptr dead_on_unwind writable sret(%"class.std::shared_ptr.10") align 8, ptr noundef nonnull align 8 dereferenceable(104), ptr noundef byval(%class.Request) align 8) local_unnamed_addr #0

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

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

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

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

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

attributes #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 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 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 = { 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 #5 = { inlinehint mustprogress nounwind uwtable "min-legal-vector-width"="0" "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #6 = { nounwind }

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

!0 = !{i32 1, !"wchar_size", i32 4}
!1 = !{i32 8, !"PIC Level", i32 2}
!2 = !{i32 7, !"PIE Level", i32 2}
!3 = !{i32 7, !"uwtable", i32 2}
!4 = !{!"clang version 19.1.0 (git@github.com:llvm/llvm-project.git a4bf6cd7cfb1a1421ba92bca9d017b49936c55e4)"}
!5 = distinct !{!5, !6}
!6 = !{!"llvm.loop.mustprogress"}


; Effective O3 passes: DSEPass,GlobalOptPass,IPSCCPPass,IndVarSimplifyPass,InferFunctionAttrsPass,InstCombinePass,MemCpyOptPass,PostOrderFunctionAttrsPass,SROAPass,SimplifyCFGPass