	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_shmem_free_object      ## -- Begin function drm_gem_shmem_free_object
	.p2align	4, 0x90
_drm_gem_shmem_free_object:             ## @drm_gem_shmem_free_object
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movq	%rdi, %r14
	callq	_to_drm_gem_shmem_obj
	movq	%rax, %rbx
	movl	40(%rax), %edi
	callq	_WARN_ON
	cmpq	$0, 8(%r14)
	je	LBB0_2
## %bb.1:
	decl	8(%rbx)
	movq	24(%rbx), %rsi
	movq	%r14, %rdi
	callq	_drm_prime_gem_destroy
	movq	16(%rbx), %rdi
	callq	_kvfree
	jmp	LBB0_6
LBB0_2:
	movq	24(%rbx), %rax
	testq	%rax, %rax
	je	LBB0_4
## %bb.3:
	movq	(%r14), %rcx
	movl	(%rcx), %edi
	movl	32(%rax), %edx
	movl	36(%rax), %esi
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	callq	_dma_unmap_sg
	movq	24(%rbx), %rdi
	callq	_sg_free_table
	movq	24(%rbx), %rdi
	callq	_kfree
LBB0_4:
	cmpq	$0, 16(%rbx)
	je	LBB0_6
## %bb.5:
	movq	%rbx, %rdi
	callq	_drm_gem_shmem_put_pages
LBB0_6:
	movl	8(%rbx), %edi
	callq	_WARN_ON
	movq	%r14, %rdi
	callq	_drm_gem_object_release
	movq	%rbx, %rdi
	addq	$4, %rdi
	callq	_mutex_destroy
	movq	%rbx, %rdi
	callq	_mutex_destroy
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_drm_gem_shmem_free_object      ; -- Begin function drm_gem_shmem_free_object
	.p2align	2
_drm_gem_shmem_free_object:             ; @drm_gem_shmem_free_object
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x20, x0
	bl	_to_drm_gem_shmem_obj
	mov	x19, x0
	ldr	w0, [x0, #40]
	bl	_WARN_ON
	ldr	x8, [x20, #8]
	cbz	x8, LBB0_2
; %bb.1:
	ldr	w8, [x19, #8]
	sub	w8, w8, #1
	str	w8, [x19, #8]
	ldr	x1, [x19, #24]
	mov	x0, x20
	bl	_drm_prime_gem_destroy
	ldr	x0, [x19, #16]
	bl	_kvfree
	b	LBB0_6
LBB0_2:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	x9, [x20]
	ldr	w0, [x9]
	ldp	w2, w1, [x8, #32]
Lloh0:
	adrp	x8, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
Lloh2:
	ldr	w3, [x8]
	bl	_dma_unmap_sg
	ldr	x0, [x19, #24]
	bl	_sg_free_table
	ldr	x0, [x19, #24]
	bl	_kfree
LBB0_4:
	ldr	x8, [x19, #16]
	cbz	x8, LBB0_6
; %bb.5:
	mov	x0, x19
	bl	_drm_gem_shmem_put_pages
LBB0_6:
	ldr	w0, [x19, #8]
	bl	_WARN_ON
	mov	x0, x20
	bl	_drm_gem_object_release
	add	x0, x19, #4
	bl	_mutex_destroy
	mov	x0, x19
	bl	_mutex_destroy
	mov	x0, x19
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
.subsections_via_symbols
