	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vmw_legacy_srf_dma
_vmw_legacy_srf_dma:                    ## @vmw_legacy_srf_dma
	.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, -52(%rbp)                 ## 4-byte Spill
	movq	%rsi, %r14
	movq	%rdi, %rbx
	callq	_vmw_res_to_srf
	movq	%rax, %r13
	movq	(%rbx), %r12
	xorl	%edi, %edi
	cmpl	$0, (%r14)
	sete	%dil
	callq	_BUG_ON
	movq	%r13, %rdi
	callq	_vmw_surface_dma_size
	movl	%eax, %ebx
	movq	%r12, %rdi
	movl	%eax, %esi
	callq	_VMW_FIFO_RESERVE
	movq	%rax, %r15
	xorl	%edi, %edi
	testq	%rax, %rax
	sete	%dil
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_2
## %bb.1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_4
LBB0_2:
	movl	(%r14), %edi
	leaq	-56(%rbp), %rsi
	callq	_vmw_bo_get_guest_ptr
	movq	%r13, %rdi
	movq	%r15, %rsi
	leaq	-56(%rbp), %rdx
	movl	-52(%rbp), %ecx                 ## 4-byte Reload
	callq	_vmw_surface_dma_encode
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_vmw_fifo_commit
	xorl	%ebx, %ebx
	leaq	-48(%rbp), %rdx
	xorl	%edi, %edi
	movq	%r12, %rsi
	xorl	%ecx, %ecx
	callq	_vmw_execbuf_fence_commands
	movl	(%r14), %edi
	movq	-48(%rbp), %rsi
	callq	_vmw_bo_fence_single
	xorl	%edi, %edi
	cmpq	$0, -48(%rbp)
	setne	%dil
	callq	_likely
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	leaq	-48(%rbp), %rdi
	callq	_vmw_fence_obj_unreference
LBB0_4:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_vmw_legacy_srf_dma
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vmw_legacy_srf_dma
_vmw_legacy_srf_dma:                    ; @vmw_legacy_srf_dma
	.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	x21, x2
	mov	x19, x1
	mov	x20, x0
	bl	_vmw_res_to_srf
	mov	x22, x0
	ldr	x20, [x20]
	ldr	w8, [x19]
	cmp	w8, #0
	cset	w0, eq
	bl	_BUG_ON
	mov	x0, x22
	bl	_vmw_surface_dma_size
	mov	x23, x0
	mov	x0, x20
	mov	x1, x23
	bl	_VMW_FIFO_RESERVE
	mov	x24, x0
	cmp	x0, #0
	cset	w0, eq
	bl	_unlikely
	cbz	x0, LBB0_2
; %bb.1:
Lloh0:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w0, w8
	b	LBB0_4
LBB0_2:
	ldr	w0, [x19]
	add	x1, sp, #12
	bl	_vmw_bo_get_guest_ptr
	add	x2, sp, #12
	mov	x0, x22
	mov	x1, x24
	mov	x3, x21
	bl	_vmw_surface_dma_encode
	mov	x0, x20
	mov	x1, x23
	bl	_vmw_fifo_commit
	mov	x2, sp
	mov	x0, #0
	mov	x1, x20
	mov	x3, #0
	bl	_vmw_execbuf_fence_commands
	ldr	w0, [x19]
	ldr	x1, [sp]
	bl	_vmw_bo_fence_single
	ldr	x8, [sp]
	cmp	x8, #0
	cset	w0, ne
	bl	_likely
	cbz	x0, LBB0_4
; %bb.3:
	mov	x0, sp
	bl	_vmw_fence_obj_unreference
	mov	w0, #0
LBB0_4:
	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 AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_vmw_legacy_srf_dma
.subsections_via_symbols
