	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap_gem_free_object           ## -- Begin function omap_gem_free_object
	.p2align	4, 0x90
_omap_gem_free_object:                  ## @omap_gem_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	%r15
	pushq	%r14
	pushq	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r14
	movq	16(%rdi), %r12
	movq	8(%r12), %r15
	callq	_to_omap_bo
	movq	%rax, %rbx
	movq	%r14, %rdi
	callq	_omap_gem_evict
	movq	%r15, %rdi
	callq	_mutex_lock
	leaq	48(%rbx), %rdi
	callq	_list_del
	movq	%r15, %rdi
	callq	_mutex_unlock
	leaq	12(%rbx), %r15
	movq	%r15, %rdi
	callq	_mutex_lock
	xorl	%edi, %edi
	cmpq	$0, (%rbx)
	setg	%dil
	callq	_WARN_ON
	movq	40(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_4
## %bb.1:
	movq	_OMAP_BO_MEM_DMABUF@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_3
## %bb.2:
	callq	_kfree
	jmp	LBB0_4
LBB0_3:
	movq	%r14, %rdi
	callq	_omap_gem_detach_pages
LBB0_4:
	movq	_OMAP_BO_MEM_DMA_API@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, 8(%rbx)
	je	LBB0_6
## %bb.5:
	movl	(%r12), %edi
	movl	8(%r14), %esi
	movq	24(%rbx), %rdx
	movl	32(%rbx), %ecx
	callq	_dma_free_wc
	jmp	LBB0_10
LBB0_6:
	movq	24(%rbx), %rdi
	testq	%rdi, %rdi
	je	LBB0_8
## %bb.7:
	callq	_vunmap
	jmp	LBB0_10
LBB0_8:
	cmpq	$0, (%r14)
	je	LBB0_10
## %bb.9:
	movl	16(%rbx), %esi
	movq	%r14, %rdi
	callq	_drm_prime_gem_destroy
LBB0_10:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%r14, %rdi
	callq	_drm_gem_object_release
	movq	%r15, %rdi
	callq	_mutex_destroy
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_OMAP_BO_MEM_DMABUF,4,2         ## @OMAP_BO_MEM_DMABUF
	.comm	_OMAP_BO_MEM_DMA_API,4,2        ## @OMAP_BO_MEM_DMA_API
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_omap_gem_free_object           ; -- Begin function omap_gem_free_object
	.p2align	2
_omap_gem_free_object:                  ; @omap_gem_free_object
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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, x0
	ldr	x22, [x0, #16]
	ldr	x21, [x22, #8]
	bl	_to_omap_bo
	mov	x19, x0
	mov	x0, x20
	bl	_omap_gem_evict
	mov	x0, x21
	bl	_mutex_lock
	add	x0, x19, #48
	bl	_list_del
	mov	x0, x21
	bl	_mutex_unlock
	add	x21, x19, #12
	mov	x0, x21
	bl	_mutex_lock
	ldr	x8, [x19]
	cmp	x8, #0
	cset	w0, gt
	bl	_WARN_ON
	ldr	x0, [x19, #40]
	cbz	x0, LBB0_4
; %bb.1:
	ldr	w8, [x19, #8]
Lloh0:
	adrp	x9, _OMAP_BO_MEM_DMABUF@GOTPAGE
Lloh1:
	ldr	x9, [x9, _OMAP_BO_MEM_DMABUF@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_3
; %bb.2:
	bl	_kfree
	b	LBB0_4
LBB0_3:
	mov	x0, x20
	bl	_omap_gem_detach_pages
LBB0_4:
	ldr	w8, [x19, #8]
Lloh3:
	adrp	x9, _OMAP_BO_MEM_DMA_API@GOTPAGE
Lloh4:
	ldr	x9, [x9, _OMAP_BO_MEM_DMA_API@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_6
; %bb.5:
	ldr	w0, [x22]
	ldr	w1, [x20, #8]
	ldr	x2, [x19, #24]
	ldr	w3, [x19, #32]
	bl	_dma_free_wc
	b	LBB0_10
LBB0_6:
	ldr	x0, [x19, #24]
	cbz	x0, LBB0_8
; %bb.7:
	bl	_vunmap
	b	LBB0_10
LBB0_8:
	ldr	x8, [x20]
	cbz	x8, LBB0_10
; %bb.9:
	ldr	w1, [x19, #16]
	mov	x0, x20
	bl	_drm_prime_gem_destroy
LBB0_10:
	mov	x0, x21
	bl	_mutex_unlock
	mov	x0, x20
	bl	_drm_gem_object_release
	mov	x0, x21
	bl	_mutex_destroy
	mov	x0, x19
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	b	_kfree
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_OMAP_BO_MEM_DMABUF,4,2         ; @OMAP_BO_MEM_DMABUF
	.comm	_OMAP_BO_MEM_DMA_API,4,2        ; @OMAP_BO_MEM_DMA_API
.subsections_via_symbols
