	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qxl_hw_surface_dealloc         ## -- Begin function qxl_hw_surface_dealloc
	.p2align	4, 0x90
_qxl_hw_surface_dealloc:                ## @qxl_hw_surface_dealloc
	.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
	cmpl	$0, (%rsi)
	je	LBB0_1
## %bb.2:
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movq	_QXL_SURFACE_CMD_DESTROY@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	8(%rbx), %rdx
	leaq	-48(%rbp), %rcx
	callq	_qxl_alloc_surface_release_reserved
	movl	%eax, %r15d
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	$0, 8(%rbx)
	movq	%r14, %rdi
	callq	_spin_lock
	leaq	4(%r14), %rdi
	movl	4(%rbx), %edx
	xorl	%r15d, %r15d
	xorl	%esi, %esi
	callq	_idr_replace
	movq	%r14, %rdi
	callq	_spin_unlock
	movl	4(%rbx), %r13d
	movq	$0, (%rbx)
	movq	-48(%rbp), %rsi
	movl	%r13d, (%rsi)
	movq	%r14, %rdi
	callq	_qxl_release_map
	movl	(%r12), %ecx
	movl	%ecx, 8(%rax)
	movl	%r13d, (%rax)
	movq	-48(%rbp), %rsi
	leaq	4(%rax), %rdx
	movq	%r14, %rdi
	callq	_qxl_release_unmap
	movq	-48(%rbp), %rsi
	movq	_QXL_CMD_SURFACE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r14, %rdi
	xorl	%ecx, %ecx
	callq	_qxl_push_command_ring_release
	movq	-48(%rbp), %rdi
	callq	_qxl_release_fence_buffer_objects
	jmp	LBB0_4
LBB0_1:
	xorl	%r15d, %r15d
LBB0_4:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_QXL_SURFACE_CMD_DESTROY,4,2    ## @QXL_SURFACE_CMD_DESTROY
	.comm	_QXL_CMD_SURFACE,4,2            ## @QXL_CMD_SURFACE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qxl_hw_surface_dealloc         ; -- Begin function qxl_hw_surface_dealloc
	.p2align	2
_qxl_hw_surface_dealloc:                ; @qxl_hw_surface_dealloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x1]
	cbz	w8, LBB0_3
; %bb.1:
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x21, _QXL_SURFACE_CMD_DESTROY@GOTPAGE
Lloh1:
	ldr	x21, [x21, _QXL_SURFACE_CMD_DESTROY@GOTPAGEOFF]
	ldr	w1, [x21]
	ldr	x2, [x20, #8]
	add	x3, sp, #8
	bl	_qxl_alloc_surface_release_reserved
	cbnz	w0, LBB0_4
; %bb.2:
	str	xzr, [x20, #8]
	mov	x0, x19
	bl	_spin_lock
	add	x0, x19, #4
	ldr	w2, [x20, #4]
	mov	x1, #0
	bl	_idr_replace
	mov	x0, x19
	bl	_spin_unlock
	ldr	w22, [x20, #4]
	str	xzr, [x20]
	ldr	x1, [sp, #8]
	str	w22, [x1]
	mov	x0, x19
	bl	_qxl_release_map
	ldr	w8, [x21]
	str	w8, [x0, #8]
	str	w22, [x0]
	ldr	x1, [sp, #8]
	add	x2, x0, #4
	mov	x0, x19
	bl	_qxl_release_unmap
	ldr	x1, [sp, #8]
Lloh2:
	adrp	x8, _QXL_CMD_SURFACE@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QXL_CMD_SURFACE@GOTPAGEOFF]
Lloh4:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w3, #0
	bl	_qxl_push_command_ring_release
	ldr	x0, [sp, #8]
	bl	_qxl_release_fence_buffer_objects
LBB0_3:
	mov	w0, #0
LBB0_4:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_QXL_SURFACE_CMD_DESTROY,4,2    ; @QXL_SURFACE_CMD_DESTROY
	.comm	_QXL_CMD_SURFACE,4,2            ; @QXL_CMD_SURFACE
.subsections_via_symbols
