	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nv04_page_flip_emit
_nv04_page_flip_emit:                   ## @nv04_page_flip_emit
	.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	%r8, -48(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	(%rdi), %rax
	movq	8(%rdi), %rbx
	movq	(%rax), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_list_add_tail
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movq	%r15, %rdi
	movq	%r13, %rsi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_nouveau_fence_sync
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.1:
	movq	%r13, %rdi
	movl	$2, %esi
	callq	_RING_SPACE
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_3
## %bb.2:
	movq	_NvSubSw@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	_NV_SW_PAGE_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	movl	$1, %ecx
	callq	_BEGIN_NV04
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	%r13, %rdi
	callq	_FIRE_RING
	movq	%r13, %rdi
	xorl	%esi, %esi
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	callq	_nouveau_fence_new
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_4
LBB0_3:
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, %rdi
	callq	_list_del
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %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	_NvSubSw,4,2                    ## @NvSubSw
	.comm	_NV_SW_PAGE_FLIP,4,2            ## @NV_SW_PAGE_FLIP
	.no_dead_strip	_nv04_page_flip_emit
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nv04_page_flip_emit
_nv04_page_flip_emit:                   ; @nv04_page_flip_emit
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	mov	x21, x4
	mov	x19, x3
	mov	x23, x1
	mov	x22, x0
	ldp	x8, x24, [x0]
	ldr	x20, [x8]
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	x1, x24
	bl	_list_add_tail
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	mov	x0, x23
	mov	x1, x22
	mov	w2, #0
	mov	w3, #0
	bl	_nouveau_fence_sync
	mov	x23, x0
	cbnz	w0, LBB0_3
; %bb.1:
	mov	x0, x22
	mov	w1, #2
	bl	_RING_SPACE
	mov	x23, x0
	cbnz	w0, LBB0_3
; %bb.2:
Lloh0:
	adrp	x8, _NvSubSw@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NvSubSw@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x8, _NV_SW_PAGE_FLIP@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NV_SW_PAGE_FLIP@GOTPAGEOFF]
Lloh5:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w3, #1
	bl	_BEGIN_NV04
	mov	x0, x22
	mov	w1, #0
	bl	_OUT_RING
	mov	x0, x22
	bl	_FIRE_RING
	mov	x0, x22
	mov	w1, #0
	mov	x2, x21
	bl	_nouveau_fence_new
	mov	x23, x0
	cbz	w0, LBB0_4
LBB0_3:
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_list_del
	mov	x0, x20
	bl	_spin_unlock_irqrestore
LBB0_4:
	mov	x0, x23
	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
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_NvSubSw,4,2                    ; @NvSubSw
	.comm	_NV_SW_PAGE_FLIP,4,2            ; @NV_SW_PAGE_FLIP
	.no_dead_strip	_nv04_page_flip_emit
.subsections_via_symbols
