	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qxl_hw_surface_alloc           ## -- Begin function qxl_hw_surface_alloc
	.p2align	4, 0x90
_qxl_hw_surface_alloc:                  ## @qxl_hw_surface_alloc
	.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
	xorl	%ebx, %ebx
	cmpl	$0, (%rsi)
	jne	LBB0_4
## %bb.1:
	movq	%rsi, %r15
	movq	%rdi, %r14
	movq	_QXL_SURFACE_CMD_CREATE@GOTPCREL(%rip), %r13
	movl	(%r13), %esi
	leaq	-48(%rbp), %rcx
	xorl	%edx, %edx
	callq	_qxl_alloc_surface_release_reserved
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.2:
	movq	-48(%rbp), %rdi
	movl	$1, %esi
	callq	_qxl_release_reserve_list
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_4
## %bb.3:
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_qxl_release_map
	movq	%rax, %r12
	movl	(%r13), %eax
	movl	%eax, 32(%r12)
	movq	_QXL_SURF_FLAG_KEEP_DATA@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, 28(%r12)
	movups	16(%r15), %xmm0
	movups	%xmm0, 12(%r12)
	xorl	%ebx, %ebx
	movq	%r14, %rdi
	movq	%r15, %rsi
	xorl	%edx, %edx
	callq	_qxl_bo_physical_address
	movl	%eax, 8(%r12)
	movl	4(%r15), %eax
	movl	%eax, 4(%r12)
	movq	-48(%rbp), %rsi
	movq	%r14, %rdi
	movq	%r12, %rdx
	callq	_qxl_release_unmap
	movq	-48(%rbp), %rsi
	movq	%rsi, 8(%r15)
	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
	movl	$1, (%r15)
	movq	%r14, %rdi
	callq	_spin_lock
	leaq	4(%r14), %rdi
	movl	4(%r15), %edx
	movq	%r15, %rsi
	callq	_idr_replace
	movq	%r14, %rdi
	callq	_spin_unlock
LBB0_4:
	movl	%ebx, %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_CREATE,4,2     ## @QXL_SURFACE_CMD_CREATE
	.comm	_QXL_SURF_FLAG_KEEP_DATA,4,2    ## @QXL_SURF_FLAG_KEEP_DATA
	.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_alloc           ; -- Begin function qxl_hw_surface_alloc
	.p2align	2
_qxl_hw_surface_alloc:                  ; @qxl_hw_surface_alloc
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	ldr	w8, [x1]
	cbz	w8, LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_4
LBB0_2:
	mov	x20, x1
	mov	x19, x0
Lloh0:
	adrp	x23, _QXL_SURFACE_CMD_CREATE@GOTPAGE
Lloh1:
	ldr	x23, [x23, _QXL_SURFACE_CMD_CREATE@GOTPAGEOFF]
	ldr	w1, [x23]
	add	x3, sp, #8
	mov	x2, #0
	bl	_qxl_alloc_surface_release_reserved
	cbnz	w0, LBB0_4
; %bb.3:
	ldr	x0, [sp, #8]
	mov	w22, #1
	mov	w1, #1
	bl	_qxl_release_reserve_list
	cbz	w0, LBB0_5
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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #80
	ret
LBB0_5:
	ldr	x1, [sp, #8]
	mov	x0, x19
	bl	_qxl_release_map
	mov	x21, x0
Lloh2:
	adrp	x8, _QXL_SURF_FLAG_KEEP_DATA@GOTPAGE
Lloh3:
	ldr	x8, [x8, _QXL_SURF_FLAG_KEEP_DATA@GOTPAGEOFF]
	ldr	w9, [x23]
Lloh4:
	ldr	w8, [x8]
	stp	w8, w9, [x0, #28]
	ldr	q0, [x20, #16]
	stur	q0, [x0, #12]
	mov	x0, x19
	mov	x1, x20
	mov	w2, #0
	bl	_qxl_bo_physical_address
	ldr	w8, [x20, #4]
	stp	w8, w0, [x21, #4]
	ldr	x1, [sp, #8]
	mov	x0, x19
	mov	x2, x21
	bl	_qxl_release_unmap
	ldr	x1, [sp, #8]
	str	x1, [x20, #8]
Lloh5:
	adrp	x8, _QXL_CMD_SURFACE@GOTPAGE
Lloh6:
	ldr	x8, [x8, _QXL_CMD_SURFACE@GOTPAGEOFF]
Lloh7:
	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
	str	w22, [x20]
	mov	x0, x19
	bl	_spin_lock
	add	x0, x19, #4
	ldr	w2, [x20, #4]
	mov	x1, x20
	bl	_idr_replace
	mov	x0, x19
	bl	_spin_unlock
	b	LBB0_1
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_QXL_SURFACE_CMD_CREATE,4,2     ; @QXL_SURFACE_CMD_CREATE
	.comm	_QXL_SURF_FLAG_KEEP_DATA,4,2    ; @QXL_SURF_FLAG_KEEP_DATA
	.comm	_QXL_CMD_SURFACE,4,2            ; @QXL_CMD_SURFACE
.subsections_via_symbols
