	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmw_legacy_srf_destroy
_vmw_legacy_srf_destroy:                ## @vmw_legacy_srf_destroy
	.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
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r13
	movq	16(%rdi), %r14
	xorl	%edi, %edi
	cmpl	$-1, (%r13)
	sete	%dil
	callq	_BUG_ON
	xorl	%r15d, %r15d
	xorl	%eax, %eax
	callq	_vmw_surface_destroy_size
	movl	%eax, %r12d
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_VMW_FIFO_RESERVE
	movq	%rax, %rbx
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	subl	(%rax), %r15d
	jmp	LBB0_3
LBB0_2:
	movl	(%r13), %edi
	movq	%rbx, %rsi
	callq	_vmw_surface_destroy_encode
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_vmw_fifo_commit
	movl	8(%r13), %eax
	subl	%eax, (%r14)
	movq	%r13, %rdi
	callq	_vmw_resource_release_id
	movq	%r14, %rdi
	callq	_vmw_fifo_resource_dec
LBB0_3:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_vmw_legacy_srf_destroy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmw_legacy_srf_destroy
_vmw_legacy_srf_destroy:                ; @vmw_legacy_srf_destroy
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	ldr	x19, [x0, #16]
	ldr	w8, [x0]
	cmn	w8, #1
	cset	w0, eq
	bl	_BUG_ON
	bl	_vmw_surface_destroy_size
	mov	x21, x0
	mov	x0, x19
	mov	x1, x21
	bl	_VMW_FIFO_RESERVE
	mov	x22, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_3
LBB0_2:
	ldr	w0, [x20]
	mov	x1, x22
	bl	_vmw_surface_destroy_encode
	mov	x0, x19
	mov	x1, x21
	bl	_vmw_fifo_commit
	ldr	w8, [x20, #8]
	ldr	w9, [x19]
	sub	w8, w9, w8
	str	w8, [x19]
	mov	x0, x20
	bl	_vmw_resource_release_id
	mov	x0, x19
	bl	_vmw_fifo_resource_dec
	mov	w0, #0
LBB0_3:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_vmw_legacy_srf_destroy
.subsections_via_symbols
