	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function virtio_gpu_transfer_to_host_ioctl
_virtio_gpu_transfer_to_host_ioctl:     ## @virtio_gpu_transfer_to_host_ioctl
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r12
	movq	(%rdi), %r14
	movq	(%rdx), %r13
	movq	$1, -80(%rbp)
	movl	8(%rsi), %esi
	movl	12(%r12), %ebx
	movq	%rdx, %rdi
	callq	_drm_gem_object_lookup
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %r15
	movq	%r14, -56(%rbp)                 ## 8-byte Spill
	movl	%ebx, -44(%rbp)                 ## 4-byte Spill
	movq	%rax, %rdi
	callq	_gem_to_virtio_gpu_obj
	movq	%rax, %r14
	movq	%rax, %rdi
	xorl	%esi, %esi
	callq	_virtio_gpu_object_reserve
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_13
## %bb.3:
	movq	%r14, %rsi
	addq	$4, %rsi
	leaq	-80(%rbp), %rdx
	movq	%r14, %rdi
	callq	_ttm_bo_validate
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_unlikely
	testq	%rax, %rax
	je	LBB0_4
LBB0_12:
	movq	%r14, %rdi
	callq	_virtio_gpu_object_unreserve
LBB0_13:
	movq	%r15, %rdi
	callq	_drm_gem_object_put_unlocked
	jmp	LBB0_14
LBB0_1:
	movq	_ENOENT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_14:
	movl	%ebx, %eax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_4:
	leaq	4(%r12), %rsi
	leaq	-72(%rbp), %rdi
	callq	_convert_to_hw_box
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	cmpl	$0, (%rdi)
	je	LBB0_5
## %bb.6:
	callq	_virtio_gpu_fence_alloc
	testq	%rax, %rax
	je	LBB0_7
## %bb.8:
	testq	%r13, %r13
	je	LBB0_9
## %bb.10:
	movl	(%r13), %edx
	jmp	LBB0_11
LBB0_5:
	movl	-60(%rbp), %ecx
	movl	-64(%rbp), %r8d
	movl	-72(%rbp), %eax
	movl	-68(%rbp), %r9d
	movq	%r14, %rsi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	pushq	$0
	pushq	%rax
	callq	_virtio_gpu_cmd_transfer_to_host_2d
	addq	$16, %rsp
	jmp	LBB0_12
LBB0_7:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_12
LBB0_9:
	xorl	%edx, %edx
LBB0_11:
	movl	(%r12), %r8d
	subq	$8, %rsp
	leaq	-72(%rbp), %r9
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	movq	%r14, %rsi
	movl	-44(%rbp), %ecx                 ## 4-byte Reload
	pushq	%rax
	movq	%rax, %r12
	callq	_virtio_gpu_cmd_transfer_to_host_3d
	addq	$16, %rsp
	movl	(%r14), %edi
	movq	%r12, %rsi
	callq	_dma_resv_add_excl_fence
	movq	%r12, %rdi
	callq	_dma_fence_put
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOENT,4,2                     ## @ENOENT
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.no_dead_strip	_virtio_gpu_transfer_to_host_ioctl
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function virtio_gpu_transfer_to_host_ioctl
_virtio_gpu_transfer_to_host_ioctl:     ; @virtio_gpu_transfer_to_host_ioctl
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x24, x1
	ldr	x22, [x0]
	ldr	x26, [x2]
	mov	w8, #1
	str	x8, [sp, #24]
	ldp	w1, w23, [x1, #8]
	mov	x0, x2
	bl	_drm_gem_object_lookup
	cbz	x0, LBB0_5
; %bb.1:
	mov	x19, x0
	bl	_gem_to_virtio_gpu_obj
	mov	x20, x0
	mov	w1, #0
	bl	_virtio_gpu_object_reserve
	mov	x21, x0
	cbnz	w0, LBB0_4
; %bb.2:
	add	x1, x20, #4
	add	x2, sp, #24
	mov	x0, x20
	bl	_ttm_bo_validate
	mov	x21, x0
	bl	_unlikely
	cbz	x0, LBB0_7
LBB0_3:
	mov	x0, x20
	bl	_virtio_gpu_object_unreserve
LBB0_4:
	mov	x0, x19
	bl	_drm_gem_object_put_unlocked
	b	LBB0_6
LBB0_5:
Lloh0:
	adrp	x8, _ENOENT@GOTPAGE
Lloh1:
	ldr	x8, [x8, _ENOENT@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	neg	w21, w8
LBB0_6:
	mov	x0, x21
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_7:
	add	x1, x24, #4
	add	x0, sp, #8
	bl	_convert_to_hw_box
	ldr	w8, [x22]
	cbz	w8, LBB0_11
; %bb.8:
	mov	x0, x22
	bl	_virtio_gpu_fence_alloc
	cbz	x0, LBB0_12
; %bb.9:
	mov	x25, x0
	cbz	x26, LBB0_13
; %bb.10:
	ldr	w2, [x26]
	b	LBB0_14
LBB0_11:
	ldp	w4, w3, [sp, #16]
	ldp	w6, w5, [sp, #8]
	mov	x0, x22
	mov	x1, x20
	mov	x2, x23
	mov	x7, #0
	bl	_virtio_gpu_cmd_transfer_to_host_2d
	b	LBB0_3
LBB0_12:
Lloh3:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w21, w8
	b	LBB0_3
LBB0_13:
	mov	w2, #0
LBB0_14:
	ldr	w4, [x24]
	add	x5, sp, #8
	mov	x0, x22
	mov	x1, x20
	mov	x3, x23
	mov	x6, x25
	bl	_virtio_gpu_cmd_transfer_to_host_3d
	ldr	w0, [x20]
	mov	x1, x25
	bl	_dma_resv_add_excl_fence
	mov	x0, x25
	bl	_dma_fence_put
	b	LBB0_3
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOENT,4,2                     ; @ENOENT
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.no_dead_strip	_virtio_gpu_transfer_to_host_ioctl
.subsections_via_symbols
