	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_page_flip_emit
_nouveau_page_flip_emit:                ## @nouveau_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%r8, -56(%rbp)                  ## 8-byte Spill
	movq	%rcx, %r14
	movq	%rsi, %r15
	movq	%rdi, %r13
	movq	(%rdi), %rax
	movq	8(%rdi), %rbx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	8(%rax), %r12
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r14, %rdi
	movq	%rbx, %rsi
	callq	_list_add_tail
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movl	(%r15), %edi
	movq	%r13, %rsi
	callq	_nouveau_fence_sync
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.1:
	movq	%r13, %rdi
	movl	$3, %esi
	callq	_RING_SPACE
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_6
## %bb.2:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_nv_device
	movq	(%rax), %rax
	movq	_NV_C0@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	jge	LBB0_4
## %bb.3:
	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
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	jmp	LBB0_5
LBB0_4:
	movq	_NV10_SUBCHAN_REF_CNT@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	movl	$1, %ecx
	callq	_BEGIN_NVC0
	movq	%r13, %rdi
	xorl	%esi, %esi
	callq	_OUT_RING
	movq	_NVSW_SUBCHAN_PAGE_FLIP@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%ecx, %ecx
	callq	_BEGIN_IMC0
LBB0_5:
	movq	%r13, %rdi
	callq	_FIRE_RING
	xorl	%r15d, %r15d
	movq	%r13, %rdi
	xorl	%esi, %esi
	movq	-56(%rbp), %rdx                 ## 8-byte Reload
	callq	_nouveau_fence_new
	movl	%eax, %ebx
	testl	%eax, %eax
	je	LBB0_7
LBB0_6:
	movq	%r12, %rdi
	callq	_spin_lock_irqsave
	movq	-64(%rbp), %rdi                 ## 8-byte Reload
	callq	_list_del
	movq	%r12, %rdi
	callq	_spin_unlock_irqrestore
	movl	%ebx, %r15d
LBB0_7:
	movl	%r15d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NV_C0,8,3                      ## @NV_C0
	.comm	_NvSubSw,4,2                    ## @NvSubSw
	.comm	_NV_SW_PAGE_FLIP,4,2            ## @NV_SW_PAGE_FLIP
	.comm	_NV10_SUBCHAN_REF_CNT,4,2       ## @NV10_SUBCHAN_REF_CNT
	.comm	_NVSW_SUBCHAN_PAGE_FLIP,4,2     ## @NVSW_SUBCHAN_PAGE_FLIP
	.no_dead_strip	_nouveau_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 nouveau_page_flip_emit
_nouveau_page_flip_emit:                ; @nouveau_page_flip_emit
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x4
	mov	x19, x3
	mov	x23, x1
	mov	x22, x0
	ldp	x25, x24, [x0]
	ldr	x20, [x25, #8]
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	mov	x1, x24
	bl	_list_add_tail
	mov	x0, x20
	bl	_spin_unlock_irqrestore
	ldr	w0, [x23]
	mov	x1, x22
	bl	_nouveau_fence_sync
	mov	x23, x0
	cbnz	w0, LBB0_6
; %bb.1:
	mov	x0, x22
	mov	w1, #3
	bl	_RING_SPACE
	mov	x23, x0
	cbnz	w0, LBB0_6
; %bb.2:
	ldr	w0, [x25]
	bl	_nv_device
	ldr	x8, [x0]
Lloh0:
	adrp	x9, _NV_C0@GOTPAGE
Lloh1:
	ldr	x9, [x9, _NV_C0@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
	cmp	x8, x9
	b.ge	LBB0_4
; %bb.3:
Lloh3:
	adrp	x8, _NvSubSw@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NvSubSw@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
Lloh6:
	adrp	x8, _NV_SW_PAGE_FLIP@GOTPAGE
Lloh7:
	ldr	x8, [x8, _NV_SW_PAGE_FLIP@GOTPAGEOFF]
Lloh8:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w3, #1
	bl	_BEGIN_NV04
	mov	x0, x22
	mov	w1, #0
	bl	_OUT_RING
	mov	x0, x22
	mov	w1, #0
	bl	_OUT_RING
	b	LBB0_5
LBB0_4:
Lloh9:
	adrp	x8, _NV10_SUBCHAN_REF_CNT@GOTPAGE
Lloh10:
	ldr	x8, [x8, _NV10_SUBCHAN_REF_CNT@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #0
	mov	w3, #1
	bl	_BEGIN_NVC0
	mov	x0, x22
	mov	w1, #0
	bl	_OUT_RING
Lloh12:
	adrp	x8, _NVSW_SUBCHAN_PAGE_FLIP@GOTPAGE
Lloh13:
	ldr	x8, [x8, _NVSW_SUBCHAN_PAGE_FLIP@GOTPAGEOFF]
Lloh14:
	ldr	w2, [x8]
	mov	x0, x22
	mov	w1, #0
	mov	w3, #0
	bl	_BEGIN_IMC0
LBB0_5:
	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_7
LBB0_6:
	mov	x0, x20
	bl	_spin_lock_irqsave
	mov	x0, x19
	bl	_list_del
	mov	x0, x20
	bl	_spin_unlock_irqrestore
LBB0_7:
	mov	x0, x23
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_NV_C0,8,3                      ; @NV_C0
	.comm	_NvSubSw,4,2                    ; @NvSubSw
	.comm	_NV_SW_PAGE_FLIP,4,2            ; @NV_SW_PAGE_FLIP
	.comm	_NV10_SUBCHAN_REF_CNT,4,2       ; @NV10_SUBCHAN_REF_CNT
	.comm	_NVSW_SUBCHAN_PAGE_FLIP,4,2     ; @NVSW_SUBCHAN_PAGE_FLIP
	.no_dead_strip	_nouveau_page_flip_emit
.subsections_via_symbols
