	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function nouveau_gem_set_domain
_nouveau_gem_set_domain:                ## @nouveau_gem_set_domain
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movl	%edx, %r15d
	movl	%esi, %ebx
	callq	_nouveau_gem_object
	testl	%r15d, %r15d
	cmovnel	%r15d, %ebx
	andl	%r14d, %ebx
	andl	(%rax), %ebx
	je	LBB0_1
## %bb.2:
	movq	_NOUVEAU_GEM_DOMAIN_VRAM@GOTPCREL(%rip), %rcx
	movl	(%rcx), %esi
	movl	%esi, %ecx
	movq	_TTM_PL_FLAG_VRAM@GOTPCREL(%rip), %rdx
	andl	%r14d, %ecx
	je	LBB0_4
## %bb.3:
	movl	(%rdx), %ecx
LBB0_4:
	movq	_NOUVEAU_GEM_DOMAIN_GART@GOTPCREL(%rip), %rdi
	movl	(%rdi), %edi
	movq	_TTM_PL_FLAG_TT@GOTPCREL(%rip), %r8
	andl	%edi, %r14d
	je	LBB0_6
## %bb.5:
	movl	(%r8), %r14d
LBB0_6:
	orl	%ecx, %r14d
	testl	%ebx, %esi
	je	LBB0_8
## %bb.7:
	movq	8(%rax), %r9
	movq	_TTM_PL_VRAM@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %r9
	je	LBB0_13
LBB0_8:
	testl	%ebx, %edi
	je	LBB0_10
## %bb.9:
	movq	8(%rax), %rcx
	movq	_TTM_PL_TT@GOTPCREL(%rip), %rdi
	movq	%r8, %rdx
	cmpq	(%rdi), %rcx
	je	LBB0_13
LBB0_10:
	testl	%ebx, %esi
	jne	LBB0_11
## %bb.12:
	movq	_TTM_PL_FLAG_TT@GOTPCREL(%rip), %rdx
	jmp	LBB0_13
LBB0_1:
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	jmp	LBB0_14
LBB0_11:
	movq	_TTM_PL_FLAG_VRAM@GOTPCREL(%rip), %rdx
LBB0_13:
	movl	(%rdx), %esi
	movq	%rax, %rdi
	movl	%r14d, %edx
	callq	_nouveau_bo_placement_set
	xorl	%eax, %eax
LBB0_14:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_NOUVEAU_GEM_DOMAIN_VRAM,4,2    ## @NOUVEAU_GEM_DOMAIN_VRAM
	.comm	_TTM_PL_FLAG_VRAM,4,2           ## @TTM_PL_FLAG_VRAM
	.comm	_NOUVEAU_GEM_DOMAIN_GART,4,2    ## @NOUVEAU_GEM_DOMAIN_GART
	.comm	_TTM_PL_FLAG_TT,4,2             ## @TTM_PL_FLAG_TT
	.comm	_TTM_PL_VRAM,8,3                ## @TTM_PL_VRAM
	.comm	_TTM_PL_TT,8,3                  ## @TTM_PL_TT
	.no_dead_strip	_nouveau_gem_set_domain
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function nouveau_gem_set_domain
_nouveau_gem_set_domain:                ; @nouveau_gem_set_domain
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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	x19, x3
	mov	x20, x2
	mov	x21, x1
	bl	_nouveau_gem_object
	ldr	w8, [x0]
	cmp	w20, #0
	csel	w9, w21, w20, eq
	and	w9, w9, w19
	ands	w9, w9, w8
	b.eq	LBB0_7
; %bb.1:
Lloh0:
	adrp	x8, _NOUVEAU_GEM_DOMAIN_VRAM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _NOUVEAU_GEM_DOMAIN_VRAM@GOTPAGEOFF]
Lloh2:
	ldr	w11, [x8]
Lloh3:
	adrp	x8, _TTM_PL_FLAG_VRAM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _TTM_PL_FLAG_VRAM@GOTPAGEOFF]
	ldr	w10, [x8]
	tst	w11, w19
	csel	w13, wzr, w10, eq
Lloh5:
	adrp	x12, _NOUVEAU_GEM_DOMAIN_GART@GOTPAGE
Lloh6:
	ldr	x12, [x12, _NOUVEAU_GEM_DOMAIN_GART@GOTPAGEOFF]
Lloh7:
	adrp	x10, _TTM_PL_FLAG_TT@GOTPAGE
Lloh8:
	ldr	x10, [x10, _TTM_PL_FLAG_TT@GOTPAGEOFF]
Lloh9:
	ldr	w12, [x12]
	ldr	w14, [x10]
	tst	w12, w19
	csel	w14, wzr, w14, eq
	orr	w2, w14, w13
	ands	w11, w11, w9
	b.eq	LBB0_4
; %bb.2:
	ldr	x13, [x0, #8]
Lloh10:
	adrp	x14, _TTM_PL_VRAM@GOTPAGE
Lloh11:
	ldr	x14, [x14, _TTM_PL_VRAM@GOTPAGEOFF]
Lloh12:
	ldr	x14, [x14]
	cmp	x13, x14
	b.ne	LBB0_4
; %bb.3:
Lloh13:
	adrp	x8, _TTM_PL_FLAG_VRAM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _TTM_PL_FLAG_VRAM@GOTPAGEOFF]
	b	LBB0_9
LBB0_4:
	tst	w12, w9
	b.eq	LBB0_8
; %bb.5:
	ldr	x9, [x0, #8]
Lloh15:
	adrp	x12, _TTM_PL_TT@GOTPAGE
Lloh16:
	ldr	x12, [x12, _TTM_PL_TT@GOTPAGEOFF]
Lloh17:
	ldr	x12, [x12]
	cmp	x9, x12
	b.ne	LBB0_8
; %bb.6:
Lloh18:
	adrp	x8, _TTM_PL_FLAG_TT@GOTPAGE
Lloh19:
	ldr	x8, [x8, _TTM_PL_FLAG_TT@GOTPAGEOFF]
	b	LBB0_9
LBB0_7:
Lloh20:
	adrp	x8, _EINVAL@GOTPAGE
Lloh21:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh22:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_10
LBB0_8:
	cmp	w11, #0
	csel	x8, x10, x8, eq
LBB0_9:
	ldr	w1, [x8]
	bl	_nouveau_bo_placement_set
	mov	w0, #0
LBB0_10:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh9
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh18, Lloh19
	.loh AdrpLdrGotLdr	Lloh20, Lloh21, Lloh22
	.cfi_endproc
                                        ; -- End function
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_NOUVEAU_GEM_DOMAIN_VRAM,4,2    ; @NOUVEAU_GEM_DOMAIN_VRAM
	.comm	_TTM_PL_FLAG_VRAM,4,2           ; @TTM_PL_FLAG_VRAM
	.comm	_NOUVEAU_GEM_DOMAIN_GART,4,2    ; @NOUVEAU_GEM_DOMAIN_GART
	.comm	_TTM_PL_FLAG_TT,4,2             ; @TTM_PL_FLAG_TT
	.comm	_TTM_PL_VRAM,8,3                ; @TTM_PL_VRAM
	.comm	_TTM_PL_TT,8,3                  ; @TTM_PL_TT
	.no_dead_strip	_nouveau_gem_set_domain
.subsections_via_symbols
