	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qxl_primary_atomic_update
_qxl_primary_atomic_update:             ## @qxl_primary_atomic_update
	.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	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	(%rdi), %rax
	movq	8(%rdi), %rcx
	movq	(%rcx), %r14
	movq	(%rax), %rax
	movq	8(%rax), %rax
	movl	(%rax), %edi
	callq	_gem_to_qxl_bo
	movq	%rax, %r15
	movq	(%r12), %rax
	movq	(%rax), %rax
	movl	(%rax), %ecx
	movl	%ecx, -48(%rbp)
	movl	4(%rax), %eax
	movl	%eax, -44(%rbp)
	movq	$0, -40(%rbp)
	movq	16(%r15), %rbx
	testq	%rbx, %rbx
	cmoveq	%r15, %rbx
	cmpl	$0, 8(%rbx)
	je	LBB0_1
## %bb.4:
	cmpq	$0, (%r15)
	je	LBB0_5
LBB0_6:
	movq	(%r14), %rax
	movq	(%r12), %rcx
	movq	8(%rcx), %rdx
	movq	(%rdx), %rdx
	movl	(%rax,%rdx,4), %eax
	jmp	LBB0_7
LBB0_1:
	cmpq	$0, 8(%r14)
	je	LBB0_3
## %bb.2:
	movq	%r14, %rdi
	callq	_qxl_io_destroy_primary
LBB0_3:
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_qxl_io_create_primary
	movq	%r12, %rdi
	callq	_qxl_primary_apply_cursor
	cmpq	$0, (%r15)
	jne	LBB0_6
LBB0_5:
	movq	(%r12), %rcx
	xorl	%eax, %eax
LBB0_7:
	movq	(%rcx), %rsi
	subq	$8, %rsp
	leaq	-48(%rbp), %r9
	movq	%r14, %rdi
	movq	%r15, %rdx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	pushq	%rax
	pushq	$1
	pushq	$1
	callq	_qxl_draw_dirty_fb
	addq	$48, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_qxl_primary_atomic_update
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qxl_primary_atomic_update
_qxl_primary_atomic_update:             ; @qxl_primary_atomic_update
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	mov	x21, x0
	ldp	x9, x8, [x0]
	ldr	x19, [x8]
	ldr	x8, [x9]
	ldr	x8, [x8, #8]
	ldr	w0, [x8]
	bl	_gem_to_qxl_bo
	mov	x20, x0
	ldr	x8, [x21]
	ldr	x8, [x8]
	ldr	d0, [x8]
	str	d0, [sp, #16]
	str	xzr, [sp, #24]
	ldr	x8, [x0, #16]
	cmp	x8, #0
	csel	x22, x0, x8, eq
	ldr	w8, [x22, #8]
	cbz	w8, LBB0_3
; %bb.1:
	ldr	x8, [x20]
	cbz	x8, LBB0_6
LBB0_2:
	ldr	x9, [x19]
	ldr	x8, [x21]
	ldr	x10, [x8, #8]
	ldr	x10, [x10]
	ldr	w9, [x9, x10, lsl #2]
	b	LBB0_7
LBB0_3:
	ldr	x8, [x19, #8]
	cbz	x8, LBB0_5
; %bb.4:
	mov	x0, x19
	bl	_qxl_io_destroy_primary
LBB0_5:
	mov	x0, x19
	mov	x1, x22
	bl	_qxl_io_create_primary
	mov	x0, x21
	bl	_qxl_primary_apply_cursor
	ldr	x8, [x20]
	cbnz	x8, LBB0_2
LBB0_6:
	mov	w9, #0
	ldr	x8, [x21]
LBB0_7:
	ldr	x1, [x8]
	str	w9, [sp]
	add	x5, sp, #16
	mov	x0, x19
	mov	x2, x20
	mov	w3, #0
	mov	w4, #0
	mov	w6, #1
	mov	w7, #1
	bl	_qxl_draw_dirty_fb
	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
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_qxl_primary_atomic_update
.subsections_via_symbols
