	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ReleaseBuffer                  ## -- Begin function ReleaseBuffer
	.p2align	4, 0x90
_ReleaseBuffer:                         ## @ReleaseBuffer
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%edi, %ebx
	callq	_BufferIsValid
	testl	%eax, %eax
	jne	LBB0_2
## %bb.1:
	movq	_ERROR@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	leaq	L_.str(%rip), %rsi
	movl	%ebx, %edx
	callq	_elog
LBB0_2:
	movl	%ebx, %edi
	callq	_BufferIsLocal
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	_CurrentResourceOwner@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	movl	%ebx, %esi
	callq	_ResourceOwnerForgetBuffer
	movq	_LocalRefCount@GOTPCREL(%rip), %r14
	movq	(%r14), %rax
	notl	%ebx
	movslq	%ebx, %rbx
	xorl	%edi, %edi
	cmpq	$0, (%rax,%rbx,8)
	setg	%dil
	callq	_Assert
	movq	(%r14), %rax
	decq	(%rax,%rbx,8)
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_4:
	decl	%ebx
	movl	%ebx, %edi
	callq	_GetBufferDescriptor
	movl	%eax, %edi
	movl	$1, %esi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_UnpinBuffer                    ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_ERROR,4,2                      ## @ERROR
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bad buffer ID: %d"

	.comm	_CurrentResourceOwner,4,2       ## @CurrentResourceOwner
	.comm	_LocalRefCount,8,3              ## @LocalRefCount
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ReleaseBuffer                  ; -- Begin function ReleaseBuffer
	.p2align	2
_ReleaseBuffer:                         ; @ReleaseBuffer
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x19, x0
	bl	_BufferIsValid
	cbnz	w0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ERROR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ERROR@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
Lloh3:
	adrp	x1, l_.str@PAGE
Lloh4:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x19
	bl	_elog
LBB0_2:
	mov	x0, x19
	bl	_BufferIsLocal
	cbz	x0, LBB0_4
; %bb.3:
Lloh5:
	adrp	x8, _CurrentResourceOwner@GOTPAGE
Lloh6:
	ldr	x8, [x8, _CurrentResourceOwner@GOTPAGEOFF]
Lloh7:
	ldr	w0, [x8]
	mov	x1, x19
	bl	_ResourceOwnerForgetBuffer
Lloh8:
	adrp	x20, _LocalRefCount@GOTPAGE
Lloh9:
	ldr	x20, [x20, _LocalRefCount@GOTPAGEOFF]
	ldr	x8, [x20]
	mvn	w9, w19
	sbfiz	x19, x9, #3, #32
	ldr	x8, [x8, x19]
	cmp	x8, #0
	cset	w0, gt
	bl	_Assert
	ldr	x8, [x20]
	ldr	x9, [x8, x19]
	sub	x9, x9, #1
	str	x9, [x8, x19]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_4:
	sub	w0, w19, #1
	bl	_GetBufferDescriptor
	mov	w1, #1
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_UnpinBuffer
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh8, Lloh9
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_ERROR,4,2                      ; @ERROR
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bad buffer ID: %d"

	.comm	_CurrentResourceOwner,4,2       ; @CurrentResourceOwner
	.comm	_LocalRefCount,8,3              ; @LocalRefCount
.subsections_via_symbols
