	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmw_cmdbuf_alloc_space
_vmw_cmdbuf_alloc_space:                ## @vmw_cmdbuf_alloc_space
	.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	%r12
	pushq	%rbx
	subq	$16, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r14d
	movq	%rsi, %rbx
	movq	%rdi, %r15
	movq	%rdx, %rdi
	callq	_PAGE_ALIGN
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	sarl	%cl, %eax
	movl	%eax, -48(%rbp)
	movq	%rbx, -40(%rbp)
	movl	$0, -44(%rbp)
	movq	%r15, %rdi
	testl	%r14d, %r14d
	je	LBB0_3
## %bb.1:
	callq	_mutex_lock_interruptible
	testq	%rax, %rax
	je	LBB0_4
## %bb.2:
	movq	_ERESTARTSYS@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_11
LBB0_3:
	callq	_mutex_lock
LBB0_4:
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_vmw_cmdbuf_try_alloc
	testq	%rax, %rax
	jne	LBB0_10
## %bb.5:
	movq	8(%r15), %rdi
	movq	_SVGA_IRQFLAG_COMMAND_BUFFER@GOTPCREL(%rip), %r12
	movl	(%r12), %esi
	movq	%rdi, %rdx
	callq	_vmw_generic_waiter_add
	movl	16(%r15), %ebx
	leaq	-48(%rbp), %rsi
	movq	%r15, %rdi
	callq	_vmw_cmdbuf_try_alloc
	movl	%ebx, %edi
	movq	%rax, %rsi
	testl	%r14d, %r14d
	je	LBB0_8
## %bb.6:
	callq	_wait_event_interruptible
	testl	%eax, %eax
	je	LBB0_9
## %bb.7:
	movl	%eax, %ebx
	movq	8(%r15), %rdi
	movl	(%r12), %esi
	movq	%rdi, %rdx
	callq	_vmw_generic_waiter_remove
	movq	%r15, %rdi
	callq	_mutex_unlock
	jmp	LBB0_11
LBB0_8:
	callq	_wait_event
LBB0_9:
	movq	8(%r15), %rdi
	movl	(%r12), %esi
	movq	%rdi, %rdx
	callq	_vmw_generic_waiter_remove
LBB0_10:
	movq	%r15, %rdi
	callq	_mutex_unlock
	xorl	%ebx, %ebx
LBB0_11:
	movl	%ebx, %eax
	addq	$16, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_ERESTARTSYS,4,2                ## @ERESTARTSYS
	.comm	_SVGA_IRQFLAG_COMMAND_BUFFER,4,2 ## @SVGA_IRQFLAG_COMMAND_BUFFER
	.no_dead_strip	_vmw_cmdbuf_alloc_space
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmw_cmdbuf_alloc_space
_vmw_cmdbuf_alloc_space:                ; @vmw_cmdbuf_alloc_space
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.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
	mov	x20, x3
	mov	x21, x1
	mov	x19, x0
	mov	x0, x2
	bl	_PAGE_ALIGN
Lloh0:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	asr	w8, w0, w8
	str	x21, [sp, #8]
	stp	w8, wzr, [sp]
	mov	x0, x19
	cbz	w20, LBB0_3
; %bb.1:
	bl	_mutex_lock_interruptible
	cbz	x0, LBB0_4
; %bb.2:
Lloh3:
	adrp	x8, _ERESTARTSYS@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ERESTARTSYS@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w20, w8
	b	LBB0_11
LBB0_3:
	bl	_mutex_lock
LBB0_4:
	mov	x1, sp
	mov	x0, x19
	bl	_vmw_cmdbuf_try_alloc
	cbnz	x0, LBB0_10
; %bb.5:
	ldr	x0, [x19, #8]
Lloh6:
	adrp	x22, _SVGA_IRQFLAG_COMMAND_BUFFER@GOTPAGE
Lloh7:
	ldr	x22, [x22, _SVGA_IRQFLAG_COMMAND_BUFFER@GOTPAGEOFF]
	ldr	w1, [x22]
	mov	x2, x0
	bl	_vmw_generic_waiter_add
	ldr	w21, [x19, #16]
	mov	x1, sp
	mov	x0, x19
	bl	_vmw_cmdbuf_try_alloc
	mov	x1, x0
	mov	x0, x21
	cbz	w20, LBB0_8
; %bb.6:
	bl	_wait_event_interruptible
	cbz	w0, LBB0_9
; %bb.7:
	mov	x20, x0
	ldr	x0, [x19, #8]
	ldr	w1, [x22]
	mov	x2, x0
	bl	_vmw_generic_waiter_remove
	mov	x0, x19
	bl	_mutex_unlock
	b	LBB0_11
LBB0_8:
	bl	_wait_event
LBB0_9:
	ldr	x0, [x19, #8]
	ldr	w1, [x22]
	mov	x2, x0
	bl	_vmw_generic_waiter_remove
LBB0_10:
	mov	x0, x19
	bl	_mutex_unlock
	mov	w20, #0
LBB0_11:
	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
	add	sp, sp, #64
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_ERESTARTSYS,4,2                ; @ERESTARTSYS
	.comm	_SVGA_IRQFLAG_COMMAND_BUFFER,4,2 ; @SVGA_IRQFLAG_COMMAND_BUFFER
	.no_dead_strip	_vmw_cmdbuf_alloc_space
.subsections_via_symbols
