	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_bo_pin_in_vram_or_gmr      ## -- Begin function vmw_bo_pin_in_vram_or_gmr
	.p2align	4, 0x90
_vmw_bo_pin_in_vram_or_gmr:             ## @vmw_bo_pin_in_vram_or_gmr
	.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
	movl	%edx, %ebx
	movq	%rsi, %r14
	movq	%rdi, %r12
	movl	%edx, -48(%rbp)
	movl	$0, -44(%rbp)
	movl	%edx, %esi
	callq	_ttm_write_lock
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_12
## %bb.1:
	leaq	8(%r14), %r15
	movq	%r12, %rdi
	callq	_vmw_execbuf_release_pinned_bo
	movq	%r15, %rdi
	movl	%ebx, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ttm_bo_reserve
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%eax, %eax
	setne	%dil
	callq	_unlikely
	testq	%rax, %rax
	jne	LBB0_11
## %bb.2:
	cmpq	$0, (%r14)
	jle	LBB0_5
## %bb.3:
	movq	_vmw_vram_gmr_placement@GOTPCREL(%rip), %rdi
	leaq	-52(%rbp), %rdx
	movq	%r15, %rsi
	callq	_ttm_bo_mem_compat
	cmpl	$1, %eax
	je	LBB0_9
## %bb.4:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
	jmp	LBB0_8
LBB0_5:
	movq	_vmw_vram_gmr_placement@GOTPCREL(%rip), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_ttm_bo_validate
	movl	%eax, %r13d
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_likely
	testq	%rax, %rax
	jne	LBB0_8
## %bb.6:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	addl	%r13d, %eax
	je	LBB0_8
## %bb.7:
	movq	_vmw_vram_placement@GOTPCREL(%rip), %rsi
	leaq	-48(%rbp), %rdx
	movq	%r15, %rdi
	callq	_ttm_bo_validate
	movl	%eax, %r13d
LBB0_8:
	testl	%r13d, %r13d
	jne	LBB0_10
LBB0_9:
	movq	%r14, %rdi
	movl	$1, %esi
	callq	_vmw_bo_pin_reserved
	xorl	%r13d, %r13d
LBB0_10:
	movq	%r15, %rdi
	callq	_ttm_bo_unreserve
LBB0_11:
	movq	%r12, %rdi
	callq	_ttm_write_unlock
LBB0_12:
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_vmw_vram_gmr_placement,4,2     ## @vmw_vram_gmr_placement
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_vmw_vram_placement,4,2         ## @vmw_vram_placement
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_bo_pin_in_vram_or_gmr      ; -- Begin function vmw_bo_pin_in_vram_or_gmr
	.p2align	2
_vmw_bo_pin_in_vram_or_gmr:             ; @vmw_bo_pin_in_vram_or_gmr
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	mov	x23, x2
	mov	x20, x1
	mov	x19, x0
	stp	w2, wzr, [sp, #8]
	mov	x1, x2
	bl	_ttm_write_lock
	mov	x22, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_12
; %bb.1:
	add	x21, x20, #8
	mov	x0, x19
	bl	_vmw_execbuf_release_pinned_bo
	mov	x0, x21
	mov	x1, x23
	mov	w2, #0
	mov	x3, #0
	bl	_ttm_bo_reserve
	mov	x22, x0
	cmp	w0, #0
	cset	w0, ne
	bl	_unlikely
	cbnz	x0, LBB0_11
; %bb.2:
	ldr	x8, [x20]
	cmp	x8, #1
	b.lt	LBB0_5
; %bb.3:
Lloh0:
	adrp	x0, _vmw_vram_gmr_placement@GOTPAGE
Lloh1:
	ldr	x0, [x0, _vmw_vram_gmr_placement@GOTPAGEOFF]
	add	x2, sp, #4
	mov	x1, x21
	bl	_ttm_bo_mem_compat
	cmp	w0, #1
	b.eq	LBB0_9
; %bb.4:
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_8
LBB0_5:
Lloh5:
	adrp	x1, _vmw_vram_gmr_placement@GOTPAGE
Lloh6:
	ldr	x1, [x1, _vmw_vram_gmr_placement@GOTPAGEOFF]
	add	x2, sp, #8
	mov	x0, x21
	bl	_ttm_bo_validate
	mov	x22, x0
	cmp	w0, #0
	cset	w0, eq
	bl	_likely
	cbnz	x0, LBB0_8
; %bb.6:
Lloh7:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh8:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh9:
	ldr	w8, [x8]
	cmn	w22, w8
	b.eq	LBB0_8
; %bb.7:
Lloh10:
	adrp	x1, _vmw_vram_placement@GOTPAGE
Lloh11:
	ldr	x1, [x1, _vmw_vram_placement@GOTPAGEOFF]
	add	x2, sp, #8
	mov	x0, x21
	bl	_ttm_bo_validate
	mov	x22, x0
LBB0_8:
	cbnz	w22, LBB0_10
LBB0_9:
	mov	x0, x20
	mov	w1, #1
	bl	_vmw_bo_pin_reserved
	mov	w22, #0
LBB0_10:
	mov	x0, x21
	bl	_ttm_bo_unreserve
LBB0_11:
	mov	x0, x19
	bl	_ttm_write_unlock
LBB0_12:
	mov	x0, x22
	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
	add	sp, sp, #80
	ret
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_vmw_vram_gmr_placement,4,2     ; @vmw_vram_gmr_placement
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_vmw_vram_placement,4,2         ; @vmw_vram_placement
.subsections_via_symbols
