	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_btrestrpos                     ## -- Begin function btrestrpos
	.p2align	4, 0x90
_btrestrpos:                            ## @btrestrpos
	.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	%rbx
	subq	$40, %rsp
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r15
	movslq	(%rdi), %rbx
	cmpq	$0, 96(%rbx)
	je	LBB0_2
## %bb.1:
	movq	%r15, %rdi
	callq	__bt_restore_array_keys
LBB0_2:
	movq	(%rbx), %rax
	testq	%rax, %rax
	js	LBB0_4
## %bb.3:
	movq	%rax, 16(%rbx)
LBB0_14:
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	16(%rbx), %r14
	movups	16(%rbx), %xmm0
	movups	32(%rbx), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_BTScanPosIsValid
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	cmpq	$0, 8(%rbx)
	jle	LBB0_7
## %bb.6:
	movq	%r15, %rdi
	callq	__bt_killitems
LBB0_7:
	movups	(%r14), %xmm0
	movups	16(%r14), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_BTScanPosUnpinIfPinned
LBB0_8:
	movups	48(%rbx), %xmm0
	movups	64(%rbx), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_BTScanPosIsValid
	testq	%rax, %rax
	je	LBB0_13
## %bb.9:
	leaq	48(%rbx), %r15
	movups	(%r15), %xmm0
	movups	16(%r15), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_BTScanPosIsPinned
	testq	%rax, %rax
	je	LBB0_11
## %bb.10:
	movl	72(%rbx), %edi
	callq	_IncrBufferRefCount
LBB0_11:
	movq	_BTScanPosData@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movq	_items@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movl	4(%rax), %esi
	callq	_offsetof
	movslq	56(%rbx), %rcx
	leaq	(%rax,%rcx,4), %rdx
	movq	%r14, %rdi
	movq	%r15, %rsi
	callq	_memcpy
	movq	88(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_14
## %bb.12:
	movq	64(%rbx), %rdx
	movq	80(%rbx), %rsi
	addq	$40, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_memcpy                         ## TAILCALL
LBB0_13:
	movups	(%r14), %xmm0
	movups	16(%r14), %xmm1
	movups	%xmm1, 16(%rsp)
	movups	%xmm0, (%rsp)
	callq	_BTScanPosInvalidate
	jmp	LBB0_14
	.cfi_endproc
                                        ## -- End function
	.comm	_BTScanPosData,4,2              ## @BTScanPosData
	.comm	_items,8,3                      ## @items
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_btrestrpos                     ; -- Begin function btrestrpos
	.p2align	2
_btrestrpos:                            ; @btrestrpos
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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
	mov	x20, x0
	ldrsw	x21, [x0]
	ldr	x8, [x21, #96]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x20
	bl	__bt_restore_array_keys
LBB0_2:
	ldr	x8, [x21]
	tbnz	x8, #63, LBB0_5
; %bb.3:
	str	x8, [x21, #16]
LBB0_4:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	add	x19, x21, #16
	ldp	q0, q1, [x21, #16]
	stp	q0, q1, [sp]
	mov	x0, sp
	bl	_BTScanPosIsValid
	cbz	x0, LBB0_9
; %bb.6:
	ldr	x8, [x21, #8]
	cmp	x8, #1
	b.lt	LBB0_8
; %bb.7:
	mov	x0, x20
	bl	__bt_killitems
LBB0_8:
	ldp	q0, q1, [x19]
	stp	q0, q1, [sp]
	mov	x0, sp
	bl	_BTScanPosUnpinIfPinned
LBB0_9:
	ldp	q0, q1, [x21, #48]
	stp	q0, q1, [sp]
	mov	x0, sp
	bl	_BTScanPosIsValid
	cbz	x0, LBB0_14
; %bb.10:
	add	x20, x21, #48
	ldp	q0, q1, [x20]
	stp	q0, q1, [sp]
	mov	x0, sp
	bl	_BTScanPosIsPinned
	cbz	x0, LBB0_12
; %bb.11:
	ldr	w0, [x21, #72]
	bl	_IncrBufferRefCount
LBB0_12:
Lloh0:
	adrp	x8, _BTScanPosData@GOTPAGE
Lloh1:
	ldr	x8, [x8, _BTScanPosData@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x8, _items@GOTPAGE
Lloh4:
	ldr	x8, [x8, _items@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	ldr	w1, [x8, #4]
	bl	_offsetof
	ldrsw	x8, [x21, #56]
	add	x2, x0, x8, lsl #2
	mov	x0, x19
	mov	x1, x20
	bl	_memcpy
	ldr	x0, [x21, #88]
	cbz	x0, LBB0_4
; %bb.13:
	ldr	x1, [x21, #80]
	ldr	x2, [x21, #64]
	bl	_memcpy
	b	LBB0_4
LBB0_14:
	ldp	q0, q1, [x19]
	stp	q0, q1, [sp]
	mov	x0, sp
	bl	_BTScanPosInvalidate
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_BTScanPosData,4,2              ; @BTScanPosData
	.comm	_items,8,3                      ; @items
.subsections_via_symbols
