	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qxl_plane_prepare_fb
_qxl_plane_prepare_fb:                  ## @qxl_plane_prepare_fb
	.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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	8(%rsi), %rax
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r12
	movq	%rdi, %rbx
	movq	8(%rdi), %rcx
	movq	(%rcx), %r14
	movq	(%rax), %rax
	movq	(%rax), %rdi
	callq	_gem_to_qxl_bo
	movq	%rax, %r15
	movq	(%rbx), %rax
	movq	_DRM_PLANE_TYPE_PRIMARY@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jne	LBB0_13
## %bb.3:
	cmpq	$0, 8(%r15)
	je	LBB0_13
## %bb.4:
	movq	(%r12), %rax
	movl	(%rax), %esi
	movq	%r14, %rdi
	movq	%r15, %rdx
	callq	_qxl_update_dumb_head
	leaq	-48(%rbp), %rsi
	movq	%r14, %rdi
	callq	_qxl_calc_dumb_shadow
	movq	(%r14), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.5:
	movq	8(%rdi), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_7
## %bb.6:
	movl	16(%rdi), %eax
	cmpl	-40(%rbp), %eax
	je	LBB0_9
LBB0_7:
	callq	_drm_gem_object_put_unlocked
	movq	$0, (%r14)
LBB0_8:
	movl	-36(%rbp), %esi
	imull	-40(%rbp), %esi
	movq	_QXL_GEM_DOMAIN_SURFACE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	movq	%r14, (%rsp)
	leaq	-48(%rbp), %r9
	movq	%r14, %rdi
	movl	$1, %edx
	movl	$1, %ecx
	callq	_qxl_bo_create
	movq	(%r14), %rdi
LBB0_9:
	movq	(%r15), %rax
	cmpq	%rdi, %rax
	je	LBB0_13
## %bb.10:
	testq	%rax, %rax
	je	LBB0_12
## %bb.11:
	movq	%rax, %rdi
	callq	_drm_gem_object_put_unlocked
	movq	$0, (%r15)
	movq	(%r14), %rdi
LBB0_12:
	callq	_drm_gem_object_get
	movq	(%r14), %rax
	movq	%rax, (%r15)
LBB0_13:
	movq	%r15, %rdi
	callq	_qxl_bo_pin
	jmp	LBB0_14
LBB0_1:
	xorl	%eax, %eax
LBB0_14:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_DRM_PLANE_TYPE_PRIMARY,8,3     ## @DRM_PLANE_TYPE_PRIMARY
	.comm	_QXL_GEM_DOMAIN_SURFACE,4,2     ## @QXL_GEM_DOMAIN_SURFACE
	.no_dead_strip	_qxl_plane_prepare_fb
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qxl_plane_prepare_fb
_qxl_plane_prepare_fb:                  ; @qxl_plane_prepare_fb
	.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	x8, [x1, #8]
	cbz	x8, LBB0_13
; %bb.1:
	mov	x21, x1
	mov	x22, x0
	ldr	x9, [x0, #8]
	ldr	x19, [x9]
	ldr	x8, [x8]
	ldr	x0, [x8]
	bl	_gem_to_qxl_bo
	mov	x20, x0
	ldr	x8, [x22]
Lloh0:
	adrp	x9, _DRM_PLANE_TYPE_PRIMARY@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DRM_PLANE_TYPE_PRIMARY@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ne	LBB0_12
; %bb.2:
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_12
; %bb.3:
	ldr	x8, [x21]
	ldr	w1, [x8]
	mov	x0, x19
	mov	x2, x20
	bl	_qxl_update_dumb_head
	mov	x1, sp
	mov	x0, x19
	bl	_qxl_calc_dumb_shadow
	ldr	x0, [x19]
	cbz	x0, LBB0_7
; %bb.4:
	ldr	x8, [x0, #8]
	ldr	x9, [sp]
	cmp	x8, x9
	b.ne	LBB0_6
; %bb.5:
	ldr	w8, [x0, #16]
	ldr	w9, [sp, #8]
	cmp	w8, w9
	b.eq	LBB0_8
LBB0_6:
	bl	_drm_gem_object_put_unlocked
	str	xzr, [x19]
LBB0_7:
	ldp	w8, w9, [sp, #8]
	mul	w1, w9, w8
Lloh3:
	adrp	x8, _QXL_GEM_DOMAIN_SURFACE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _QXL_GEM_DOMAIN_SURFACE@GOTPAGEOFF]
Lloh5:
	ldr	w4, [x8]
	mov	x5, sp
	mov	x0, x19
	mov	w2, #1
	mov	w3, #1
	mov	x6, x19
	bl	_qxl_bo_create
	ldr	x0, [x19]
LBB0_8:
	ldr	x8, [x20]
	cmp	x8, x0
	b.eq	LBB0_12
; %bb.9:
	cbz	x8, LBB0_11
; %bb.10:
	mov	x0, x8
	bl	_drm_gem_object_put_unlocked
	str	xzr, [x20]
	ldr	x0, [x19]
LBB0_11:
	bl	_drm_gem_object_get
	ldr	x8, [x19]
	str	x8, [x20]
LBB0_12:
	mov	x0, x20
	bl	_qxl_bo_pin
	b	LBB0_14
LBB0_13:
	mov	w0, #0
LBB0_14:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_DRM_PLANE_TYPE_PRIMARY,8,3     ; @DRM_PLANE_TYPE_PRIMARY
	.comm	_QXL_GEM_DOMAIN_SURFACE,4,2     ; @QXL_GEM_DOMAIN_SURFACE
	.no_dead_strip	_qxl_plane_prepare_fb
.subsections_via_symbols
