	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_bo_pin                 ## -- Begin function nouveau_bo_pin
	.p2align	4, 0x90
_nouveau_bo_pin:                        ## @nouveau_bo_pin
	.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
	movl	%esi, %r12d
	movq	%rdi, %r13
	leaq	8(%rdi), %r14
	movl	16(%rdi), %edi
	callq	_nouveau_bdev
	movq	%rax, %r15
	movq	%r14, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_ttm_bo_reserve
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.1:
	movq	(%r13), %rdx
	testq	%rdx, %rdx
	je	LBB0_5
## %bb.2:
	movl	(%r14), %ecx
	movl	$1, %eax
	shll	%cl, %eax
	btl	%ecx, %r12d
	jae	LBB0_3
## %bb.4:
	incq	%rdx
	movq	%rdx, (%r13)
LBB0_10:
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_5:
	movq	$1, (%r13)
	movq	%r13, %rdi
	movl	%r12d, %esi
	xorl	%edx, %edx
	callq	_nouveau_bo_placement_set
	movq	%r13, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	callq	_nouveau_bo_validate
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_11
## %bb.6:
	movl	(%r14), %eax
	cmpl	$129, %eax
	je	LBB0_9
## %bb.7:
	cmpl	$128, %eax
	jne	LBB0_10
## %bb.8:
	movl	12(%r13), %eax
	subl	%eax, 4(%r15)
	jmp	LBB0_10
LBB0_3:
	leaq	L_.str(%rip), %rsi
	movq	%r15, %rdi
	movq	%r14, %rdx
	movl	%eax, %ecx
	movl	%r12d, %r8d
	callq	_NV_ERROR
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_11:
	movq	%r14, %rdi
	callq	_ttm_bo_unreserve
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movl	12(%r13), %eax
	subl	%eax, (%r15)
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"bo %p pinned elsewhere: 0x%08x vs 0x%08x\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_nouveau_bo_pin                 ; -- Begin function nouveau_bo_pin
	.p2align	2
_nouveau_bo_pin:                        ; @nouveau_bo_pin
	.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	x22, x1
	mov	x21, x0
	add	x19, x0, #8
	ldr	w0, [x0, #16]
	bl	_nouveau_bdev
	mov	x20, x0
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	w4, #0
	bl	_ttm_bo_reserve
	mov	x23, x0
	cbz	w0, LBB0_2
LBB0_1:
	mov	x0, x19
	bl	_ttm_bo_unreserve
	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
LBB0_2:
	ldr	x8, [x21]
	cbz	x8, LBB0_5
; %bb.3:
	ldr	w9, [x19]
	mov	w10, #1
	lsl	w3, w10, w9
	tst	w3, w22
	b.eq	LBB0_9
; %bb.4:
	mov	w23, #0
	add	x8, x8, #1
	str	x8, [x21]
	b	LBB0_1
LBB0_5:
	mov	w8, #1
	str	x8, [x21]
	mov	x0, x21
	mov	x1, x22
	mov	w2, #0
	bl	_nouveau_bo_placement_set
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	bl	_nouveau_bo_validate
	mov	x23, x0
	cbnz	w0, LBB0_1
; %bb.6:
	ldr	w8, [x19]
	cmp	w8, #129
	b.eq	LBB0_10
; %bb.7:
	cmp	w8, #128
	b.ne	LBB0_11
; %bb.8:
	mov	w23, #0
	ldr	w8, [x21, #12]
	ldr	w9, [x20, #4]
	sub	w8, w9, w8
	str	w8, [x20, #4]
	b	LBB0_1
LBB0_9:
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x20
	mov	x2, x19
	mov	x4, x22
	bl	_NV_ERROR
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w23, w8
	b	LBB0_1
LBB0_10:
	mov	w23, #0
	ldr	w8, [x21, #12]
	ldr	w9, [x20]
	sub	w8, w9, w8
	str	w8, [x20]
	b	LBB0_1
LBB0_11:
	mov	w23, #0
	b	LBB0_1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"bo %p pinned elsewhere: 0x%08x vs 0x%08x\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
.subsections_via_symbols
