	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function extent_merge_impl
_extent_merge_impl:                     ## @extent_merge_impl
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r15
	pushq	%r14
	pushq	%r13
	pushq	%r12
	pushq	%rbx
	subq	$104, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, %ebx
	movq	%r8, %r13
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r15
	callq	_tsdn_witness_tsdp_get
	movq	_WITNESS_RANK_CORE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	xorl	%edx, %edx
	testl	%ebx, %ebx
	setne	%dl
	movl	%eax, %edi
	callq	_witness_assert_depth_to_rank
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_extent_hooks_assure_initialized
	movq	(%r14), %rcx
	movl	$1, %eax
	cmpq	$0, (%rcx)
	je	LBB0_13
## %bb.1:
	cmpq	_extent_hooks_default@GOTPCREL(%rip), %rcx
	movq	%r13, -96(%rbp)                 ## 8-byte Spill
	je	LBB0_2
## %bb.3:
	movq	%r15, %rdi
	movq	%r12, %rsi
	callq	_extent_hook_pre_reentrancy
	movq	(%r14), %r14
	movq	(%r14), %rax
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_extent_base_get
	movl	%eax, -64(%rbp)                 ## 4-byte Spill
	movq	%rbx, %rdi
	callq	_extent_size_get
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	%r13, %rdi
	callq	_extent_base_get
	movl	%eax, -60(%rbp)                 ## 4-byte Spill
	movq	%r13, %rdi
	callq	_extent_size_get
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movq	%rbx, %rdi
	callq	_extent_committed_get
	movl	%eax, %r13d
	movq	%r12, %rdi
	movq	%r15, %r12
	callq	_arena_ind_get
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movl	-64(%rbp), %esi                 ## 4-byte Reload
	movq	-80(%rbp), %rdx                 ## 8-byte Reload
	movl	-60(%rbp), %ecx                 ## 4-byte Reload
	movq	-72(%rbp), %r8                  ## 8-byte Reload
	movl	%r13d, %r9d
	callq	*-88(%rbp)                      ## 8-byte Folded Reload
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_extent_hook_post_reentrancy
	jmp	LBB0_4
LBB0_2:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_extent_base_get
	movl	%eax, %ebx
	movq	%r13, %rdi
	callq	_extent_base_get
	movl	%ebx, %edi
	movl	%eax, %esi
	callq	_extent_merge_default_impl
	movl	%eax, %ebx
	movq	%r15, %r12
LBB0_4:
	testl	%ebx, %ebx
	movl	$1, %eax
	jne	LBB0_13
## %bb.5:
	leaq	-124(%rbp), %rsi
	movq	%r12, %rdi
	callq	_tsdn_rtree_ctx
	movq	%rax, %r14
	leaq	-112(%rbp), %rax
	movq	%rax, (%rsp)
	leaq	-120(%rbp), %r9
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_extent_rtree_leaf_elms_lookup
	leaq	-56(%rbp), %rax
	movq	%rax, (%rsp)
	leaq	-104(%rbp), %r9
	movq	%r12, %rdi
	movq	%r14, %rsi
	movq	-96(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rdx
	movl	$1, %ecx
	xorl	%r8d, %r8d
	callq	_extent_rtree_leaf_elms_lookup
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_extent_lock2
	movq	-112(%rbp), %rdx
	testq	%rdx, %rdx
	je	LBB0_7
## %bb.6:
	movq	_NSIZES@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_extents_rtree@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_rtree_leaf_elm_write
LBB0_7:
	cmpq	$0, -56(%rbp)
	movq	-104(%rbp), %rdx
	je	LBB0_9
## %bb.8:
	movq	_NSIZES@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	_extents_rtree@GOTPCREL(%rip), %rsi
	movq	%r12, %rdi
	xorl	%ecx, %ecx
	xorl	%r9d, %r9d
	callq	_rtree_leaf_elm_write
	jmp	LBB0_10
LBB0_9:
	movq	%rdx, -56(%rbp)
LBB0_10:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movq	%r13, %rdi
	callq	_extent_size_get
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_extent_size_get
	addq	%rax, %rbx
	movq	%r13, %rdi
	movq	%rbx, %rsi
	callq	_extent_size_set
	movq	_NSIZES@GOTPCREL(%rip), %r14
	movl	(%r14), %esi
	movq	%r13, %rdi
	callq	_extent_szind_set
	movq	%r13, %rdi
	callq	_extent_sn_get
	movq	%rax, %rbx
	movq	%r15, %rdi
	callq	_extent_sn_get
	cmpq	%rax, %rbx
	movq	%r15, %rdi
	cmovlq	%r13, %rdi
	callq	_extent_sn_get
	movq	%r13, %rdi
	movq	%rax, %rsi
	callq	_extent_sn_set
	movq	%r13, %rdi
	callq	_extent_zeroed_get
	movl	$0, %esi
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%r15, %rdi
	callq	_extent_zeroed_get
	xorl	%esi, %esi
	testq	%rax, %rax
	setne	%sil
LBB0_12:
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rdi
	callq	_extent_zeroed_set
	movq	-120(%rbp), %rsi
	movq	-56(%rbp), %rdx
	movl	(%r14), %r8d
	movq	%r12, %rdi
	movq	%rbx, %rcx
	xorl	%r9d, %r9d
	callq	_extent_rtree_write_acquired
	movq	%r12, %rdi
	movq	%rbx, %rsi
	movq	%r15, %rdx
	callq	_extent_unlock2
	movq	%r15, %rdi
	callq	_extent_arena_get
	movq	%r12, %rdi
	movl	%eax, %esi
	movq	%r15, %rdx
	callq	_extent_dalloc
	xorl	%eax, %eax
LBB0_13:
	addq	$104, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_WITNESS_RANK_CORE,4,2          ## @WITNESS_RANK_CORE
	.comm	_extent_hooks_default,8,3       ## @extent_hooks_default
	.comm	_extents_rtree,4,2              ## @extents_rtree
	.comm	_NSIZES,4,2                     ## @NSIZES
	.no_dead_strip	_extent_merge_impl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function extent_merge_impl
_extent_merge_impl:                     ; @extent_merge_impl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	.cfi_offset w21, -40
	.cfi_offset w22, -48
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x24, x5
	mov	x19, x4
	mov	x21, x3
	mov	x23, x2
	mov	x22, x1
	mov	x20, x0
	bl	_tsdn_witness_tsdp_get
Lloh0:
	adrp	x8, _WITNESS_RANK_CORE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _WITNESS_RANK_CORE@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	cmp	w24, #0
	cset	w2, ne
	bl	_witness_assert_depth_to_rank
	mov	x0, x22
	mov	x1, x23
	bl	_extent_hooks_assure_initialized
	ldr	x8, [x23]
	ldr	x9, [x8]
	cbz	x9, LBB0_3
; %bb.1:
Lloh3:
	adrp	x9, _extent_hooks_default@GOTPAGE
Lloh4:
	ldr	x9, [x9, _extent_hooks_default@GOTPAGEOFF]
	cmp	x8, x9
	b.eq	LBB0_4
; %bb.2:
	mov	x0, x20
	mov	x1, x22
	bl	_extent_hook_pre_reentrancy
	ldr	x23, [x23]
	ldr	x8, [x23]
	str	x8, [sp]                        ; 8-byte Folded Spill
	mov	x0, x21
	bl	_extent_base_get
	mov	x24, x0
	mov	x0, x21
	bl	_extent_size_get
	mov	x25, x0
	mov	x0, x19
	bl	_extent_base_get
	mov	x26, x0
	mov	x0, x19
	bl	_extent_size_get
	mov	x27, x0
	mov	x0, x21
	bl	_extent_committed_get
	mov	x28, x0
	mov	x0, x22
	bl	_arena_ind_get
	mov	x6, x0
	mov	x0, x23
	mov	x1, x24
	mov	x2, x25
	mov	x3, x26
	mov	x4, x27
	mov	x5, x28
	ldr	x8, [sp]                        ; 8-byte Folded Reload
	blr	x8
	mov	x22, x0
	mov	x0, x20
	bl	_extent_hook_post_reentrancy
	cbz	w22, LBB0_5
LBB0_3:
	mov	w0, #1
	b	LBB0_14
LBB0_4:
	mov	x0, x21
	bl	_extent_base_get
	mov	x22, x0
	mov	x0, x19
	bl	_extent_base_get
	mov	x1, x0
	mov	x0, x22
	bl	_extent_merge_default_impl
	mov	x22, x0
	cbnz	w22, LBB0_3
LBB0_5:
	add	x1, sp, #44
	mov	x0, x20
	bl	_tsdn_rtree_ctx
	mov	x22, x0
	add	x5, sp, #32
	add	x6, sp, #24
	mov	x0, x20
	mov	x1, x22
	mov	x2, x21
	mov	w3, #1
	mov	w4, #0
	bl	_extent_rtree_leaf_elms_lookup
	add	x5, sp, #16
	add	x6, sp, #8
	mov	x0, x20
	mov	x1, x22
	mov	x2, x19
	mov	w3, #1
	mov	w4, #0
	bl	_extent_rtree_leaf_elms_lookup
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_extent_lock2
	ldr	x2, [sp, #24]
Lloh5:
	adrp	x23, _NSIZES@GOTPAGE
Lloh6:
	ldr	x23, [x23, _NSIZES@GOTPAGEOFF]
	cbz	x2, LBB0_7
; %bb.6:
	ldr	w4, [x23]
Lloh7:
	adrp	x1, _extents_rtree@GOTPAGE
Lloh8:
	ldr	x1, [x1, _extents_rtree@GOTPAGEOFF]
	mov	x0, x20
	mov	x3, #0
	mov	w5, #0
	bl	_rtree_leaf_elm_write
LBB0_7:
	ldp	x8, x2, [sp, #8]
	cbz	x8, LBB0_9
; %bb.8:
	ldr	w4, [x23]
Lloh9:
	adrp	x1, _extents_rtree@GOTPAGE
Lloh10:
	ldr	x1, [x1, _extents_rtree@GOTPAGEOFF]
	mov	x0, x20
	mov	x3, #0
	mov	w5, #0
	bl	_rtree_leaf_elm_write
	b	LBB0_10
LBB0_9:
	str	x2, [sp, #8]
LBB0_10:
	mov	x0, x21
	bl	_extent_size_get
	mov	x22, x0
	mov	x0, x19
	bl	_extent_size_get
	add	x1, x0, x22
	mov	x0, x21
	bl	_extent_size_set
	ldr	w1, [x23]
	mov	x0, x21
	bl	_extent_szind_set
	mov	x0, x21
	bl	_extent_sn_get
	mov	x22, x0
	mov	x0, x19
	bl	_extent_sn_get
	cmp	x22, x0
	csel	x0, x21, x19, lt
	bl	_extent_sn_get
	mov	x1, x0
	mov	x0, x21
	bl	_extent_sn_set
	mov	x0, x21
	bl	_extent_zeroed_get
	cbz	x0, LBB0_12
; %bb.11:
	mov	x0, x19
	bl	_extent_zeroed_get
	cmp	x0, #0
	cset	w1, ne
	b	LBB0_13
LBB0_12:
	mov	w1, #0
LBB0_13:
	mov	x0, x21
	bl	_extent_zeroed_set
	ldr	x1, [sp, #32]
	ldr	x2, [sp, #8]
	ldr	w4, [x23]
	mov	x0, x20
	mov	x3, x21
	mov	w5, #0
	bl	_extent_rtree_write_acquired
	mov	x0, x20
	mov	x1, x21
	mov	x2, x19
	bl	_extent_unlock2
	mov	x0, x19
	bl	_extent_arena_get
	mov	x1, x0
	mov	x0, x20
	mov	x2, x19
	bl	_extent_dalloc
	mov	w0, #0
LBB0_14:
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.comm	_WITNESS_RANK_CORE,4,2          ; @WITNESS_RANK_CORE
	.comm	_extent_hooks_default,8,3       ; @extent_hooks_default
	.comm	_extents_rtree,4,2              ; @extents_rtree
	.comm	_NSIZES,4,2                     ; @NSIZES
	.no_dead_strip	_extent_merge_impl
.subsections_via_symbols
