; LLVM IR from pixelsdb/mini-pixels :: pixels-common/lib/MergedRequest.ll (ZN13MergedRequest5mergeE7Request)

; 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::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%class.Request = type { i64, i64, i64, i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }
%class.MergedRequest = type { %"class.std::enable_shared_from_this", i64, i64, i64, i32, i32, i32, %"class.std::vector", %"class.std::vector" }
%"class.std::enable_shared_from_this" = type { %"class.std::weak_ptr" }
%"class.std::weak_ptr" = type { %"class.std::__weak_ptr" }
%"class.std::__weak_ptr" = type { ptr, %"class.std::__weak_count" }
%"class.std::__weak_count" = type { ptr }
%"class.std::vector" = type { %"struct.std::_Vector_base" }
%"struct.std::_Vector_base" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl" = type { %"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" }
%"struct.std::_Vector_base<int, std::allocator<int>>::_Vector_impl_data" = type { ptr, ptr, ptr }

@.str = external hidden unnamed_addr constant [47 x i8], align 1
@_ZTI24InvalidArgumentException = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13MergedRequest5mergeE7Request(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8 %0, ptr noundef nonnull align 8 dereferenceable(104) %1, ptr noundef byval(%class.Request) align 8 %2) #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca ptr, align 8
  %5 = alloca ptr, align 8
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator.0", align 1
  %8 = alloca ptr, align 8
  %9 = alloca i32, align 4
  %10 = alloca i1, align 1
  %11 = alloca %"class.std::__cxx11::basic_string", align 8
  %12 = alloca %"class.std::allocator.0", align 1
  %13 = alloca i1, align 1
  %14 = alloca i64, align 8
  %15 = alloca i32, align 4
  %16 = alloca i32, align 4
  store ptr %0, ptr %4, align 8
  store ptr %1, ptr %5, align 8, !tbaa !5
  %17 = load ptr, ptr %5, align 8
  %18 = getelementptr inbounds %class.Request, ptr %2, i32 0, i32 2
  %19 = load i64, ptr %18, align 8, !tbaa !9
  %20 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 3
  %21 = load i64, ptr %20, align 8, !tbaa !12
  %22 = icmp ult i64 %19, %21
  br i1 %22, label %23, label %39

23:                                               ; preds = %3
  store i1 true, ptr %10, align 1
  %24 = call ptr @__cxa_allocate_exception(i64 8) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %7) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef @.str, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %25 unwind label %27

25:                                               ; preds = %23
  invoke void @_ZN24InvalidArgumentExceptionC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %24, ptr noundef %6)
          to label %26 unwind label %31

26:                                               ; preds = %25
  store i1 false, ptr %10, align 1
  invoke void @__cxa_throw(ptr %24, ptr @_ZTI24InvalidArgumentException, ptr @_ZNSt9exceptionD2Ev) #7
          to label %120 unwind label %31

27:                                               ; preds = %23
  %28 = landingpad { ptr, i32 }
          cleanup
  %29 = extractvalue { ptr, i32 } %28, 0
  store ptr %29, ptr %8, align 8
  %30 = extractvalue { ptr, i32 } %28, 1
  store i32 %30, ptr %9, align 4
  br label %35

31:                                               ; preds = %26, %25
  %32 = landingpad { ptr, i32 }
          cleanup
  %33 = extractvalue { ptr, i32 } %32, 0
  store ptr %33, ptr %8, align 8
  %34 = extractvalue { ptr, i32 } %32, 1
  store i32 %34, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  br label %35

35:                                               ; preds = %31, %27
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %7) #6
  %36 = load i1, ptr %10, align 1
  br i1 %36, label %37, label %38

37:                                               ; preds = %35
  call void @__cxa_free_exception(ptr %24) #6
  br label %38

38:                                               ; preds = %37, %35
  br label %115

39:                                               ; preds = %3
  %40 = getelementptr inbounds %class.Request, ptr %2, i32 0, i32 1
  %41 = load i64, ptr %40, align 8, !tbaa !23
  %42 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 1
  %43 = load i64, ptr %42, align 8, !tbaa !24
  %44 = icmp ne i64 %41, %43
  br i1 %44, label %45, label %61

45:                                               ; preds = %39
  store i1 true, ptr %13, align 1
  %46 = call ptr @__cxa_allocate_exception(i64 8) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr %12) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %11, ptr noundef @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %12)
          to label %47 unwind label %49

47:                                               ; preds = %45
  invoke void @_ZN24InvalidArgumentExceptionC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %46, ptr noundef %11)
          to label %48 unwind label %53

48:                                               ; preds = %47
  store i1 false, ptr %13, align 1
  invoke void @__cxa_throw(ptr %46, ptr @_ZTI24InvalidArgumentException, ptr @_ZNSt9exceptionD2Ev) #7
          to label %120 unwind label %53

49:                                               ; preds = %45
  %50 = landingpad { ptr, i32 }
          cleanup
  %51 = extractvalue { ptr, i32 } %50, 0
  store ptr %51, ptr %8, align 8
  %52 = extractvalue { ptr, i32 } %50, 1
  store i32 %52, ptr %9, align 4
  br label %57

53:                                               ; preds = %48, %47
  %54 = landingpad { ptr, i32 }
          cleanup
  %55 = extractvalue { ptr, i32 } %54, 0
  store ptr %55, ptr %8, align 8
  %56 = extractvalue { ptr, i32 } %54, 1
  store i32 %56, ptr %9, align 4
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %11) #6
  br label %57

57:                                               ; preds = %53, %49
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %12) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr %12) #6
  %58 = load i1, ptr %13, align 1
  br i1 %58, label %59, label %60

59:                                               ; preds = %57
  call void @__cxa_free_exception(ptr %46) #6
  br label %60

60:                                               ; preds = %59, %57
  br label %115

61:                                               ; preds = %39
  call void @llvm.lifetime.start.p0(i64 8, ptr %14) #6
  %62 = getelementptr inbounds %class.Request, ptr %2, i32 0, i32 2
  %63 = load i64, ptr %62, align 8, !tbaa !9
  %64 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 3
  %65 = load i64, ptr %64, align 8, !tbaa !12
  %66 = sub i64 %63, %65
  store i64 %66, ptr %14, align 8, !tbaa !25
  %67 = load i64, ptr %14, align 8, !tbaa !25
  %68 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 6
  %69 = load i32, ptr %68, align 8, !tbaa !26
  %70 = sext i32 %69 to i64
  %71 = icmp sle i64 %67, %70
  br i1 %71, label %72, label %113

72:                                               ; preds = %61
  %73 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 4
  %74 = load i32, ptr %73, align 8, !tbaa !27
  %75 = sext i32 %74 to i64
  %76 = load i64, ptr %14, align 8, !tbaa !25
  %77 = add nsw i64 %75, %76
  %78 = getelementptr inbounds %class.Request, ptr %2, i32 0, i32 3
  %79 = load i64, ptr %78, align 8, !tbaa !28
  %80 = add i64 %77, %79
  %81 = call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #6
  %82 = sext i32 %81 to i64
  %83 = icmp ule i64 %80, %82
  br i1 %83, label %84, label %113

84:                                               ; preds = %72
  %85 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 7
  call void @llvm.lifetime.start.p0(i64 4, ptr %15) #6
  %86 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 4
  %87 = load i32, ptr %86, align 8, !tbaa !27
  %88 = load i64, ptr %14, align 8, !tbaa !25
  %89 = trunc i64 %88 to i32
  %90 = add nsw i32 %87, %89
  store i32 %90, ptr %15, align 4, !tbaa !29
  %91 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJiEEERiDpOT_(ptr noundef nonnull align 8 dereferenceable(24) %85, ptr noundef nonnull align 4 dereferenceable(4) %15)
  call void @llvm.lifetime.end.p0(i64 4, ptr %15) #6
  %92 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 8
  %93 = getelementptr inbounds %class.Request, ptr %2, i32 0, i32 3
  %94 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRmEEERiDpOT_(ptr noundef nonnull align 8 dereferenceable(24) %92, ptr noundef nonnull align 8 dereferenceable(8) %93)
  %95 = load i64, ptr %14, align 8, !tbaa !25
  %96 = getelementptr inbounds %class.Request, ptr %2, i32 0, i32 3
  %97 = load i64, ptr %96, align 8, !tbaa !28
  %98 = add i64 %95, %97
  %99 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 4
  %100 = load i32, ptr %99, align 8, !tbaa !27
  %101 = sext i32 %100 to i64
  %102 = add i64 %101, %98
  %103 = trunc i64 %102 to i32
  store i32 %103, ptr %99, align 8, !tbaa !27
  %104 = getelementptr inbounds %class.Request, ptr %2, i32 0, i32 2
  %105 = load i64, ptr %104, align 8, !tbaa !9
  %106 = getelementptr inbounds %class.Request, ptr %2, i32 0, i32 3
  %107 = load i64, ptr %106, align 8, !tbaa !28
  %108 = add i64 %105, %107
  %109 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 3
  store i64 %108, ptr %109, align 8, !tbaa !12
  %110 = getelementptr inbounds %class.MergedRequest, ptr %17, i32 0, i32 5
  %111 = load i32, ptr %110, align 4, !tbaa !30
  %112 = add nsw i32 %111, 1
  store i32 %112, ptr %110, align 4, !tbaa !30
  call void @_ZNSt23enable_shared_from_thisI13MergedRequestE16shared_from_thisEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %17)
  store i32 1, ptr %16, align 4
  br label %114

113:                                              ; preds = %72, %61
  call void @_ZSt11make_sharedI13MergedRequestJR7RequestEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %2)
  store i32 1, ptr %16, align 4
  br label %114

114:                                              ; preds = %113, %84
  call void @llvm.lifetime.end.p0(i64 8, ptr %14) #6
  ret void

115:                                              ; preds = %60, %38
  %116 = load ptr, ptr %8, align 8
  %117 = load i32, ptr %9, align 4
  %118 = insertvalue { ptr, i32 } poison, ptr %116, 0
  %119 = insertvalue { ptr, i32 } %118, i32 %117, 1
  resume { ptr, i32 } %119

120:                                              ; preds = %48, %26
  unreachable
}

declare ptr @__cxa_allocate_exception(i64)

; 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 void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

declare void @_ZN24InvalidArgumentExceptionC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNSt9exceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr)

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

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

declare void @__cxa_free_exception(ptr)

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23enable_shared_from_thisI13MergedRequestE16shared_from_thisEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(16)) #0 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") align 8, ptr noundef nonnull align 8 dereferenceable(32)) #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 = { "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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, !11, i64 16}
!10 = !{!"_ZTS7Request", !11, i64 0, !11, i64 8, !11, i64 16, !11, i64 24}
!11 = !{!"long", !7, i64 0}
!12 = !{!13, !11, i64 32}
!13 = !{!"_ZTS13MergedRequest", !14, i64 0, !11, i64 16, !11, i64 24, !11, i64 32, !18, i64 40, !18, i64 44, !18, i64 48, !19, i64 56, !19, i64 80}
!14 = !{!"_ZTSSt23enable_shared_from_thisI13MergedRequestE", !15, i64 0}
!15 = !{!"_ZTSSt8weak_ptrI13MergedRequestE", !16, i64 0}
!16 = !{!"_ZTSSt10__weak_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0, !17, i64 8}
!17 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !6, i64 0}
!18 = !{!"int", !7, i64 0}
!19 = !{!"_ZTSSt6vectorIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !22, i64 0}
!22 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !6, i64 0, !6, i64 8, !6, i64 16}
!23 = !{!10, !11, i64 8}
!24 = !{!13, !11, i64 16}
!25 = !{!11, !11, i64 0}
!26 = !{!13, !18, i64 48}
!27 = !{!13, !18, i64 40}
!28 = !{!10, !11, i64 24}
!29 = !{!18, !18, i64 0}
!30 = !{!13, !18, i64 44}


; 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::shared_ptr" = type { %"class.std::__shared_ptr" }
%"class.std::__shared_ptr" = type { ptr, %"class.std::__shared_count" }
%"class.std::__shared_count" = type { ptr }
%class.Request = type { i64, i64, i64, i64 }
%"class.std::__cxx11::basic_string" = type { %"struct.std::__cxx11::basic_string<char>::_Alloc_hider", i64, %union.anon }
%"struct.std::__cxx11::basic_string<char>::_Alloc_hider" = type { ptr }
%union.anon = type { i64, [8 x i8] }
%"class.std::allocator.0" = type { i8 }

@.str = external hidden unnamed_addr constant [47 x i8], align 1
@_ZTI24InvalidArgumentException = external dso_local constant { ptr, ptr, ptr }, align 8
@.str.1 = external hidden unnamed_addr constant [77 x i8], align 1

; Function Attrs: mustprogress uwtable
define dso_local void @_ZN13MergedRequest5mergeE7Request(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8 %0, ptr noundef nonnull align 8 dereferenceable(104) %1, ptr noundef byval(%class.Request) align 8 %2) local_unnamed_addr #0 align 2 personality ptr @__gxx_personality_v0 {
  %4 = alloca %"class.std::__cxx11::basic_string", align 8
  %5 = alloca %"class.std::allocator.0", align 1
  %6 = alloca %"class.std::__cxx11::basic_string", align 8
  %7 = alloca %"class.std::allocator.0", align 1
  %8 = alloca i32, align 4
  %9 = getelementptr inbounds i8, ptr %2, i64 16
  %10 = load i64, ptr %9, align 8, !tbaa !5
  %11 = getelementptr inbounds i8, ptr %1, i64 32
  %12 = load i64, ptr %11, align 8, !tbaa !10
  %13 = icmp ult i64 %10, %12
  br i1 %13, label %14, label %21

14:                                               ; preds = %3
  %15 = tail call ptr @__cxa_allocate_exception(i64 8) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %5) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %4, ptr noundef nonnull @.str, ptr noundef nonnull align 1 dereferenceable(1) %5)
          to label %16 unwind label %.thread

16:                                               ; preds = %14
  invoke void @_ZN24InvalidArgumentExceptionC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %15, ptr noundef nonnull %4)
          to label %17 unwind label %19

17:                                               ; preds = %16
  invoke void @__cxa_throw(ptr nonnull %15, ptr nonnull @_ZTI24InvalidArgumentException, ptr nonnull @_ZNSt9exceptionD2Ev) #7
          to label %69 unwind label %19

.thread:                                          ; preds = %14
  %18 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  br label %.sink.split

19:                                               ; preds = %16, %17
  %.010 = phi i1 [ false, %17 ], [ true, %16 ]
  %20 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %4) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %5) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %5) #6
  br i1 %.010, label %.sink.split, label %68

21:                                               ; preds = %3
  %22 = getelementptr inbounds i8, ptr %2, i64 8
  %23 = load i64, ptr %22, align 8, !tbaa !22
  %24 = getelementptr inbounds i8, ptr %1, i64 16
  %25 = load i64, ptr %24, align 8, !tbaa !23
  %.not = icmp eq i64 %23, %25
  br i1 %.not, label %33, label %26

26:                                               ; preds = %21
  %27 = tail call ptr @__cxa_allocate_exception(i64 8) #6
  call void @llvm.lifetime.start.p0(i64 1, ptr nonnull %7) #6
  call void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  invoke void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEC2IS3_EEPKcRKS3_(ptr noundef nonnull align 8 dereferenceable(32) %6, ptr noundef nonnull @.str.1, ptr noundef nonnull align 1 dereferenceable(1) %7)
          to label %28 unwind label %.thread27

28:                                               ; preds = %26
  invoke void @_ZN24InvalidArgumentExceptionC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8) %27, ptr noundef nonnull %6)
          to label %29 unwind label %31

29:                                               ; preds = %28
  invoke void @__cxa_throw(ptr nonnull %27, ptr nonnull @_ZTI24InvalidArgumentException, ptr nonnull @_ZNSt9exceptionD2Ev) #7
          to label %69 unwind label %31

.thread27:                                        ; preds = %26
  %30 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  br label %.sink.split

31:                                               ; preds = %28, %29
  %.08 = phi i1 [ false, %29 ], [ true, %28 ]
  %32 = landingpad { ptr, i32 }
          cleanup
  call void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32) %6) #6
  call void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1) %7) #6
  call void @llvm.lifetime.end.p0(i64 1, ptr nonnull %7) #6
  br i1 %.08, label %.sink.split, label %68

33:                                               ; preds = %21
  %34 = sub i64 %10, %12
  %35 = getelementptr inbounds i8, ptr %1, i64 48
  %36 = load i32, ptr %35, align 8, !tbaa !24
  %37 = sext i32 %36 to i64
  %.not18 = icmp sgt i64 %34, %37
  br i1 %.not18, label %66, label %38

38:                                               ; preds = %33
  %39 = getelementptr inbounds i8, ptr %1, i64 40
  %40 = load i32, ptr %39, align 8, !tbaa !25
  %41 = sext i32 %40 to i64
  %42 = add nsw i64 %34, %41
  %43 = getelementptr inbounds i8, ptr %2, i64 24
  %44 = load i64, ptr %43, align 8, !tbaa !26
  %45 = add i64 %42, %44
  %46 = tail call noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() #6
  %47 = sext i32 %46 to i64
  %.not19 = icmp ugt i64 %45, %47
  br i1 %.not19, label %66, label %48

48:                                               ; preds = %38
  %49 = getelementptr inbounds i8, ptr %1, i64 56
  call void @llvm.lifetime.start.p0(i64 4, ptr nonnull %8) #6
  %50 = load i32, ptr %39, align 8, !tbaa !25
  %51 = trunc i64 %34 to i32
  %52 = add nsw i32 %50, %51
  store i32 %52, ptr %8, align 4, !tbaa !27
  %53 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJiEEERiDpOT_(ptr noundef nonnull align 8 dereferenceable(24) %49, ptr noundef nonnull align 4 dereferenceable(4) %8)
  call void @llvm.lifetime.end.p0(i64 4, ptr nonnull %8) #6
  %54 = getelementptr inbounds i8, ptr %1, i64 80
  %55 = call noundef nonnull align 4 dereferenceable(4) ptr @_ZNSt6vectorIiSaIiEE12emplace_backIJRmEEERiDpOT_(ptr noundef nonnull align 8 dereferenceable(24) %54, ptr noundef nonnull align 8 dereferenceable(8) %43)
  %56 = load i64, ptr %43, align 8, !tbaa !26
  %57 = add i64 %56, %34
  %58 = load i32, ptr %39, align 8, !tbaa !25
  %59 = trunc i64 %57 to i32
  %60 = add i32 %58, %59
  store i32 %60, ptr %39, align 8, !tbaa !25
  %61 = load i64, ptr %9, align 8, !tbaa !5
  %62 = add i64 %61, %56
  store i64 %62, ptr %11, align 8, !tbaa !10
  %63 = getelementptr inbounds i8, ptr %1, i64 44
  %64 = load i32, ptr %63, align 4, !tbaa !28
  %65 = add nsw i32 %64, 1
  store i32 %65, ptr %63, align 4, !tbaa !28
  call void @_ZNSt23enable_shared_from_thisI13MergedRequestE16shared_from_thisEv(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %0, ptr noundef nonnull align 8 dereferenceable(16) %1)
  br label %67

66:                                               ; preds = %38, %33
  call void @_ZSt11make_sharedI13MergedRequestJR7RequestEESt10shared_ptrINSt9enable_ifIXntsr8is_arrayIT_EE5valueES5_E4typeEEDpOT0_(ptr dead_on_unwind writable sret(%"class.std::shared_ptr") align 8 %0, ptr noundef nonnull align 8 dereferenceable(32) %2)
  br label %67

67:                                               ; preds = %66, %48
  ret void

.sink.split:                                      ; preds = %31, %.thread27, %19, %.thread
  %.sink = phi ptr [ %15, %.thread ], [ %15, %19 ], [ %27, %.thread27 ], [ %27, %31 ]
  %.pn21.pn.ph = phi { ptr, i32 } [ %18, %.thread ], [ %20, %19 ], [ %30, %.thread27 ], [ %32, %31 ]
  call void @__cxa_free_exception(ptr %.sink) #6
  br label %68

68:                                               ; preds = %.sink.split, %31, %19
  %.pn21.pn = phi { ptr, i32 } [ %20, %19 ], [ %32, %31 ], [ %.pn21.pn.ph, %.sink.split ]
  resume { ptr, i32 } %.pn21.pn

69:                                               ; preds = %29, %17
  unreachable
}

declare ptr @__cxa_allocate_exception(i64) local_unnamed_addr

; 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 void @_ZNSaIcEC2Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2 align 2

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

declare i32 @__gxx_personality_v0(...)

declare void @_ZN24InvalidArgumentExceptionC1ENSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEEE(ptr noundef nonnull align 8 dereferenceable(8), ptr noundef) unnamed_addr #3

; Function Attrs: nounwind
declare void @_ZNSt9exceptionD2Ev(ptr noundef nonnull align 8 dereferenceable(8)) unnamed_addr #4

declare void @__cxa_throw(ptr, ptr, ptr) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare void @_ZNSt7__cxx1112basic_stringIcSt11char_traitsIcESaIcEED2Ev(ptr noundef nonnull align 8 dereferenceable(32)) 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

declare void @__cxa_free_exception(ptr) local_unnamed_addr

; Function Attrs: mustprogress nounwind uwtable
declare dso_local noundef i32 @_ZNSt14numeric_limitsIiE3maxEv() local_unnamed_addr #2 align 2

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

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

; Function Attrs: mustprogress uwtable
declare dso_local void @_ZNSt23enable_shared_from_thisI13MergedRequestE16shared_from_thisEv(ptr dead_on_unwind noalias writable sret(%"class.std::shared_ptr") align 8, ptr noundef nonnull align 8 dereferenceable(16)) local_unnamed_addr #0 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") align 8, ptr noundef nonnull align 8 dereferenceable(32)) local_unnamed_addr #5

; Function Attrs: mustprogress nounwind uwtable
declare dso_local void @_ZNSt15__new_allocatorIcED2Ev(ptr noundef nonnull align 1 dereferenceable(1)) 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 = { "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 = { nounwind "no-trapping-math"="true" "stack-protector-buffer-size"="8" "target-cpu"="x86-64" "target-features"="+cmov,+cx8,+fxsr,+mmx,+sse,+sse2,+x87" "tune-cpu"="generic" }
attributes #5 = { 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 #6 = { nounwind }
attributes #7 = { noreturn }

!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, !7, i64 16}
!6 = !{!"_ZTS7Request", !7, i64 0, !7, i64 8, !7, i64 16, !7, i64 24}
!7 = !{!"long", !8, i64 0}
!8 = !{!"omnipotent char", !9, i64 0}
!9 = !{!"Simple C++ TBAA"}
!10 = !{!11, !7, i64 32}
!11 = !{!"_ZTS13MergedRequest", !12, i64 0, !7, i64 16, !7, i64 24, !7, i64 32, !17, i64 40, !17, i64 44, !17, i64 48, !18, i64 56, !18, i64 80}
!12 = !{!"_ZTSSt23enable_shared_from_thisI13MergedRequestE", !13, i64 0}
!13 = !{!"_ZTSSt8weak_ptrI13MergedRequestE", !14, i64 0}
!14 = !{!"_ZTSSt10__weak_ptrI13MergedRequestLN9__gnu_cxx12_Lock_policyE2EE", !15, i64 0, !16, i64 8}
!15 = !{!"any pointer", !8, i64 0}
!16 = !{!"_ZTSSt12__weak_countILN9__gnu_cxx12_Lock_policyE2EE", !15, i64 0}
!17 = !{!"int", !8, i64 0}
!18 = !{!"_ZTSSt6vectorIiSaIiEE", !19, i64 0}
!19 = !{!"_ZTSSt12_Vector_baseIiSaIiEE", !20, i64 0}
!20 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE12_Vector_implE", !21, i64 0}
!21 = !{!"_ZTSNSt12_Vector_baseIiSaIiEE17_Vector_impl_dataE", !15, i64 0, !15, i64 8, !15, i64 16}
!22 = !{!6, !7, i64 8}
!23 = !{!11, !7, i64 16}
!24 = !{!11, !17, i64 48}
!25 = !{!11, !17, i64 40}
!26 = !{!6, !7, i64 24}
!27 = !{!17, !17, i64 0}
!28 = !{!11, !17, i64 44}


; Effective O3 passes: EarlyCSEPass,GlobalOptPass,InferFunctionAttrsPass,InstCombinePass,JumpThreadingPass,ReassociatePass,SROAPass,SimplifyCFGPass,TailCallElimPass