	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gem_ioctl_cpu_prep     ## -- Begin function nouveau_gem_ioctl_cpu_prep
	.p2align	4, 0x90
_nouveau_gem_ioctl_cpu_prep:            ## @nouveau_gem_ioctl_cpu_prep
	.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	%rdx, %rdi
	movl	(%rsi), %r13d
	movl	4(%rsi), %esi
	movq	_NOUVEAU_GEM_CPU_PREP_NOWAIT@GOTPCREL(%rip), %rax
	movl	(%rax), %r15d
	movq	_NOUVEAU_GEM_CPU_PREP_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r14
	xorl	%r12d, %r12d
	testl	%r13d, %ebx
	setne	%r12b
	movq	%rax, %rdi
	callq	_nouveau_gem_object
	movl	%r15d, %edx
	movq	%rax, %r15
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shll	$5, %ecx
	subl	%eax, %ecx
	subl	%eax, %ecx
	xorl	%ebx, %ebx
	testl	%r13d, %edx
	movl	(%r15), %edi
	cmovnel	%ebx, %ecx
	movl	%r12d, %esi
	movl	$1, %edx
	callq	_dma_resv_wait_timeout_rcu
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	xorl	%edx, %edx
	subl	(%rcx), %edx
	testq	%rax, %rax
	cmovsq	%rax, %rbx
	cmovel	%edx, %ebx
	movq	%r15, %rdi
	callq	_nouveau_bo_sync_for_cpu
	movq	%r14, %rdi
	callq	_drm_gem_object_put_unlocked
	jmp	LBB0_3
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_3:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_NOUVEAU_GEM_CPU_PREP_NOWAIT,4,2 ## @NOUVEAU_GEM_CPU_PREP_NOWAIT
	.comm	_NOUVEAU_GEM_CPU_PREP_WRITE,4,2 ## @NOUVEAU_GEM_CPU_PREP_WRITE
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_HZ,4,2                         ## @HZ
	.comm	_EBUSY,4,2                      ## @EBUSY
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_gem_ioctl_cpu_prep     ; -- Begin function nouveau_gem_ioctl_cpu_prep
	.p2align	2
_nouveau_gem_ioctl_cpu_prep:            ; @nouveau_gem_ioctl_cpu_prep
	.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	x0, x2
Lloh0:
	adrp	x8, _NOUVEAU_GEM_CPU_PREP_NOWAIT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NOUVEAU_GEM_CPU_PREP_NOWAIT@GOTPAGEOFF]
Lloh2:
	ldr	w22, [x8]
Lloh3:
	adrp	x8, _NOUVEAU_GEM_CPU_PREP_WRITE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _NOUVEAU_GEM_CPU_PREP_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w20, [x8]
	ldp	w23, w1, [x1]
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_2
; %bb.1:
	mov	x19, x0
	tst	w20, w23
	cset	w20, ne
	bl	_nouveau_gem_object
	mov	x21, x0
Lloh6:
	adrp	x8, _HZ@GOTPAGE
Lloh7:
	ldr	x8, [x8, _HZ@GOTPAGEOFF]
	ldr	w0, [x0]
Lloh8:
	ldr	w8, [x8]
	mov	w9, #30
	mul	w8, w8, w9
	tst	w22, w23
	csel	w3, w8, wzr, eq
	mov	x1, x20
	mov	w2, #1
	bl	_dma_resv_wait_timeout_rcu
Lloh9:
	adrp	x8, _EBUSY@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh11:
	ldr	w8, [x8]
	cmp	x0, #0
	csel	x9, x0, xzr, lt
	csneg	w20, w9, w8, ne
	mov	x0, x21
	bl	_nouveau_bo_sync_for_cpu
	mov	x0, x19
	bl	_drm_gem_object_put_unlocked
	b	LBB0_3
LBB0_2:
Lloh12:
	adrp	x8, _ENOENT@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w20, w8
LBB0_3:
	mov	x0, x20
	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
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.cfi_endproc
                                        ; -- End function
	.comm	_NOUVEAU_GEM_CPU_PREP_NOWAIT,4,2 ; @NOUVEAU_GEM_CPU_PREP_NOWAIT
	.comm	_NOUVEAU_GEM_CPU_PREP_WRITE,4,2 ; @NOUVEAU_GEM_CPU_PREP_WRITE
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_HZ,4,2                         ; @HZ
	.comm	_EBUSY,4,2                      ; @EBUSY
.subsections_via_symbols
