	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_virtio_gpu_object_create       ## -- Begin function virtio_gpu_object_create
	.p2align	4, 0x90
_virtio_gpu_object_create:              ## @virtio_gpu_object_create
	.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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rcx, %r14
	movq	%rdx, %r15
	movq	%rsi, %r12
	movq	%rdi, %r13
	movq	$0, (%rdx)
	addq	$4, %rdi
	movl	(%rsi), %esi
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movl	$20, %edx
	callq	_ttm_bo_dma_acc_size
	movq	%rax, -88(%rbp)                 ## 8-byte Spill
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movl	$20, %edi
	callq	_kzalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.2:
	movq	%rax, %rbx
	movq	%r14, -64(%rbp)                 ## 8-byte Spill
	movq	%r15, -80(%rbp)                 ## 8-byte Spill
	leaq	16(%rax), %rsi
	movq	%r13, %rdi
	callq	_virtio_gpu_resource_id_get
	testl	%eax, %eax
	js	LBB0_3
## %bb.5:
	movl	(%r12), %edi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	callq	_roundup
	movl	%eax, (%r12)
	movl	8(%r13), %edi
	leaq	4(%rbx), %r15
	movq	%r15, %rsi
	movl	%eax, %edx
	callq	_drm_gem_object_init
	testl	%eax, %eax
	je	LBB0_7
## %bb.6:
	movl	%eax, %r14d
	movl	16(%rbx), %esi
	movq	%r13, %rdi
	callq	_virtio_gpu_resource_id_put
	jmp	LBB0_4
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
	jmp	LBB0_18
LBB0_3:
	movl	%eax, %r14d
LBB0_4:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_18:
	movl	%r14d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r13, -72(%rbp)                 ## 8-byte Spill
	movl	16(%r12), %eax
	movl	%eax, 12(%rbx)
	cmpq	$0, 8(%r12)
	je	LBB0_9
## %bb.8:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r12, %rdx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	callq	_virtio_gpu_cmd_resource_create_3d
	jmp	LBB0_10
LBB0_9:
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%r12, %rdx
	movq	-64(%rbp), %rcx                 ## 8-byte Reload
	callq	_virtio_gpu_cmd_create_resource
LBB0_10:
	movq	%rbx, %rdi
	callq	_virtio_gpu_init_ttm_placement
	movl	(%r12), %edx
	movq	_ttm_bo_type_device@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	%rbx, %r8
	addq	$8, %r8
	movq	_virtio_gpu_ttm_bo_destroy@GOTPCREL(%rip), %rax
	movq	%rax, 32(%rsp)
	xorps	%xmm0, %xmm0
	movups	%xmm0, 16(%rsp)
	movq	-88(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%rsp)
	movl	$1, (%rsp)
	movq	-96(%rbp), %rdi                 ## 8-byte Reload
	movq	%rbx, %rsi
	xorl	%r9d, %r9d
	callq	_ttm_bo_init
	movl	%eax, %r14d
	testl	%eax, %eax
	jne	LBB0_18
## %bb.11:
	cmpq	$0, -64(%rbp)                   ## 8-byte Folded Reload
	je	LBB0_17
## %bb.12:
	leaq	-48(%rbp), %r14
	movq	%r14, %rdi
	callq	_INIT_LIST_HEAD
	leaq	-112(%rbp), %r12
	movq	%r12, %rdi
	xorl	%esi, %esi
	movl	$16, %edx
	callq	_memset
	movq	%r15, %rdi
	callq	_drm_gem_object_get
	movq	%rbx, -104(%rbp)
	movq	%r12, %rdi
	movq	%r14, %rsi
	callq	_list_add
	leaq	-56(%rbp), %rdi
	movq	%r14, %rsi
	callq	_virtio_gpu_object_list_validate
	testl	%eax, %eax
	jne	LBB0_16
## %bb.13:
	movq	-72(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_spin_lock_irqsave
	movq	-64(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %rdi
	callq	_virtio_fence_signaled
	testl	%eax, %eax
	je	LBB0_14
## %bb.15:
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
	leaq	-56(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	callq	_ttm_eu_backoff_reservation
	jmp	LBB0_16
LBB0_14:
	leaq	-56(%rbp), %rdi
	leaq	-48(%rbp), %rsi
	movq	%r12, %rdx
	callq	_ttm_eu_fence_buffer_objects
	movq	%r14, %rdi
	callq	_spin_unlock_irqrestore
LBB0_16:
	leaq	-48(%rbp), %rdi
	callq	_virtio_gpu_unref_list
LBB0_17:
	movq	-80(%rbp), %rax                 ## 8-byte Reload
	movq	%rbx, (%rax)
	xorl	%r14d, %r14d
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.comm	_ttm_bo_type_device,4,2         ## @ttm_bo_type_device
	.comm	_virtio_gpu_ttm_bo_destroy,4,2  ## @virtio_gpu_ttm_bo_destroy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_virtio_gpu_object_create       ; -- Begin function virtio_gpu_object_create
	.p2align	2
_virtio_gpu_object_create:              ; @virtio_gpu_object_create
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #160
	.cfi_def_cfa_offset 160
	stp	x28, x27, [sp, #64]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #80]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #96]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #112]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #128]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #144]            ; 16-byte Folded Spill
	add	x29, sp, #144
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x22, x3
	mov	x19, x2
	mov	x26, x1
	mov	x21, x0
	str	xzr, [x2]
	add	x23, x0, #4
	ldr	w1, [x1]
	mov	x0, x23
	mov	w2, #20
	bl	_ttm_bo_dma_acc_size
	mov	x24, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
	mov	w0, #20
	bl	_kzalloc
	cbz	x0, LBB0_4
; %bb.1:
	mov	x20, x0
	add	x1, x0, #16
	mov	x0, x21
	bl	_virtio_gpu_resource_id_get
	tbnz	w0, #31, LBB0_5
; %bb.2:
	ldr	w0, [x26]
Lloh3:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	w1, [x8]
	bl	_roundup
	mov	x2, x0
	str	w0, [x26]
	ldr	w0, [x21, #8]
	add	x25, x20, #4
	mov	x1, x25
	bl	_drm_gem_object_init
	cbz	w0, LBB0_8
; %bb.3:
	mov	x27, x0
	ldr	w1, [x20, #16]
	mov	x0, x21
	bl	_virtio_gpu_resource_id_put
	b	LBB0_6
LBB0_4:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w27, w8
	b	LBB0_7
LBB0_5:
	mov	x27, x0
LBB0_6:
	mov	x0, x20
	bl	_kfree
LBB0_7:
	mov	x0, x27
	ldp	x29, x30, [sp, #144]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #128]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #112]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #96]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #80]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #64]             ; 16-byte Folded Reload
	add	sp, sp, #160
	ret
LBB0_8:
	ldr	w8, [x26, #16]
	str	w8, [x20, #12]
	ldr	x8, [x26, #8]
	cbz	x8, LBB0_10
; %bb.9:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x26
	mov	x3, x22
	bl	_virtio_gpu_cmd_resource_create_3d
	b	LBB0_11
LBB0_10:
	mov	x0, x21
	mov	x1, x20
	mov	x2, x26
	mov	x3, x22
	bl	_virtio_gpu_cmd_create_resource
LBB0_11:
	mov	x0, x20
	bl	_virtio_gpu_init_ttm_placement
	ldr	w2, [x26]
Lloh9:
	adrp	x8, _ttm_bo_type_device@GOTPAGE
Lloh10:
	ldr	x8, [x8, _ttm_bo_type_device@GOTPAGEOFF]
Lloh11:
	ldr	w3, [x8]
	add	x4, x20, #8
	stp	xzr, xzr, [sp]
Lloh12:
	adrp	x8, _virtio_gpu_ttm_bo_destroy@GOTPAGE
Lloh13:
	ldr	x8, [x8, _virtio_gpu_ttm_bo_destroy@GOTPAGEOFF]
	str	x8, [sp, #16]
	mov	x0, x23
	mov	x1, x20
	mov	w5, #0
	mov	w6, #1
	mov	x7, x24
	bl	_ttm_bo_init
	mov	x27, x0
	cbnz	w0, LBB0_7
; %bb.12:
	cbz	x22, LBB0_18
; %bb.13:
	add	x0, sp, #56
	bl	_INIT_LIST_HEAD
	add	x0, sp, #40
	mov	w1, #0
	mov	w2, #16
	bl	_memset
	mov	x0, x25
	bl	_drm_gem_object_get
	str	x20, [sp, #48]
	add	x0, sp, #40
	add	x1, sp, #56
	bl	_list_add
	add	x0, sp, #32
	add	x1, sp, #56
	bl	_virtio_gpu_object_list_validate
	cbnz	w0, LBB0_17
; %bb.14:
	mov	x0, x21
	bl	_spin_lock_irqsave
	mov	x0, x22
	bl	_virtio_fence_signaled
	cbz	w0, LBB0_16
; %bb.15:
	mov	x0, x21
	bl	_spin_unlock_irqrestore
	add	x0, sp, #32
	add	x1, sp, #56
	bl	_ttm_eu_backoff_reservation
	b	LBB0_17
LBB0_16:
	add	x0, sp, #32
	add	x1, sp, #56
	mov	x2, x22
	bl	_ttm_eu_fence_buffer_objects
	mov	x0, x21
	bl	_spin_unlock_irqrestore
LBB0_17:
	add	x0, sp, #56
	bl	_virtio_gpu_unref_list
LBB0_18:
	mov	w27, #0
	str	x20, [x19]
	b	LBB0_7
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.comm	_ttm_bo_type_device,4,2         ; @ttm_bo_type_device
	.comm	_virtio_gpu_ttm_bo_destroy,4,2  ; @virtio_gpu_ttm_bo_destroy
.subsections_via_symbols
