	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_resource_pin               ## -- Begin function vmw_resource_pin
	.p2align	4, 0x90
_vmw_resource_pin:                      ## @vmw_resource_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r13d
	movq	%rdi, %r12
	movl	%esi, -48(%rbp)
	movl	$0, -44(%rbp)
	movq	24(%rdi), %r15
	movq	%r15, %rdi
	callq	_ttm_write_lock
	leaq	4(%r15), %r14
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r12, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	callq	_vmw_resource_reserve
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_12
## %bb.1:
	movq	(%r12), %rax
	testq	%rax, %rax
	je	LBB0_2
LBB0_10:
	incq	%rax
	movq	%rax, (%r12)
	xorl	%ebx, %ebx
	jmp	LBB0_11
LBB0_2:
	movq	16(%r12), %rbx
	testq	%rbx, %rbx
	je	LBB0_3
## %bb.4:
	movq	%rbx, %rdi
	movl	%r13d, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	callq	_ttm_bo_reserve
	movq	%rbx, %rdi
	cmpl	$0, 4(%rbx)
	je	LBB0_5
LBB0_7:
	movq	%rdi, -56(%rbp)                 ## 8-byte Spill
	movl	$1, %esi
	callq	_vmw_bo_pin_reserved
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_vmw_resource_validate
	movl	%eax, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	callq	_ttm_bo_unreserve
	testl	%ebx, %ebx
	jne	LBB0_11
	jmp	LBB0_9
LBB0_3:
	movq	%r12, %rdi
	movl	%r13d, %esi
	callq	_vmw_resource_validate
	movl	%eax, %ebx
	testl	%ebx, %ebx
	jne	LBB0_11
LBB0_9:
	movq	(%r12), %rax
	jmp	LBB0_10
LBB0_5:
	movq	8(%r12), %rax
	movl	(%rax), %esi
	leaq	-48(%rbp), %rdx
	movq	%rbx, %rdi
	callq	_ttm_bo_validate
	movq	%rbx, %rdi
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %ebx
	callq	_ttm_bo_unreserve
LBB0_11:
	movq	%r12, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	xorl	%r9d, %r9d
	callq	_vmw_resource_unreserve
LBB0_12:
	movq	%r14, %rdi
	callq	_mutex_unlock
	movq	%r15, %rdi
	callq	_ttm_write_unlock
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_vmw_resource_pin               ; -- Begin function vmw_resource_pin
	.p2align	2
_vmw_resource_pin:                      ; @vmw_resource_pin
	.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	x22, x1
	mov	x21, x0
	stp	w1, wzr, [sp, #8]
	ldr	x19, [x0, #24]
	mov	x0, x19
	bl	_ttm_write_lock
	add	x20, x19, #4
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x21
	mov	x1, x22
	mov	w2, #0
	bl	_vmw_resource_reserve
	mov	x23, x0
	cbnz	w0, LBB0_11
; %bb.1:
	ldr	x8, [x21]
	cbz	x8, LBB0_3
LBB0_2:
	mov	w23, #0
	add	x8, x8, #1
	str	x8, [x21]
	b	LBB0_10
LBB0_3:
	ldr	x24, [x21, #16]
	cbz	x24, LBB0_6
; %bb.4:
	mov	x0, x24
	mov	x1, x22
	mov	w2, #0
	mov	x3, #0
	bl	_ttm_bo_reserve
	ldr	w8, [x24, #4]
	cbz	w8, LBB0_8
LBB0_5:
	mov	x0, x24
	mov	w1, #1
	bl	_vmw_bo_pin_reserved
	mov	x0, x21
	mov	x1, x22
	bl	_vmw_resource_validate
	mov	x23, x0
	mov	x0, x24
	bl	_ttm_bo_unreserve
	cbnz	w23, LBB0_10
	b	LBB0_7
LBB0_6:
	mov	x0, x21
	mov	x1, x22
	bl	_vmw_resource_validate
	mov	x23, x0
	cbnz	w23, LBB0_10
LBB0_7:
	ldr	x8, [x21]
	b	LBB0_2
LBB0_8:
	ldr	x8, [x21, #8]
	ldr	w1, [x8]
	add	x2, sp, #8
	mov	x0, x24
	bl	_ttm_bo_validate
	cbz	w0, LBB0_5
; %bb.9:
	mov	x23, x0
	mov	x0, x24
	bl	_ttm_bo_unreserve
LBB0_10:
	mov	x0, x21
	mov	w1, #0
	mov	w2, #0
	mov	w3, #0
	mov	x4, #0
	mov	x5, #0
	bl	_vmw_resource_unreserve
LBB0_11:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	bl	_ttm_write_unlock
	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
	add	sp, sp, #80
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
