	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function panfrost_gem_free_object
_panfrost_gem_free_object:              ## @panfrost_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	callq	_to_panfrost_bo
	movq	%rax, %r13
	movq	(%rbx), %rax
	movq	(%rax), %r15
	movq	8(%r13), %rdi
	testq	%rdi, %rdi
	je	LBB0_7
## %bb.1:
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	movl	4(%r13), %eax
	movq	_SZ_2M@GOTPCREL(%rip), %rcx
	cltd
	idivl	(%rcx)
	testl	%eax, %eax
	jle	LBB0_6
## %bb.2:
	movl	%eax, %r12d
	shlq	$4, %r12
	xorl	%ebx, %ebx
	movq	_DMA_BIDIRECTIONAL@GOTPCREL(%rip), %r14
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_5:                                 ##   in Loop: Header=BB0_3 Depth=1
	movq	8(%r13), %rdi
	addq	$16, %rbx
	cmpq	%rbx, %r12
	je	LBB0_6
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%rdi,%rbx), %rsi
	testq	%rsi, %rsi
	je	LBB0_5
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	4(%r15), %eax
	movl	(%rdi,%rbx), %edx
	movl	(%r14), %ecx
	movl	%eax, %edi
	callq	_dma_unmap_sg
	movq	8(%r13), %rdi
	addq	%rbx, %rdi
	callq	_sg_free_table
	jmp	LBB0_5
LBB0_6:
	callq	_kfree
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_7:
	movq	%r15, %rdi
	callq	_mutex_lock
	movq	%r13, %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_9
## %bb.8:
	movq	%r13, %rdi
	callq	_list_del
LBB0_9:
	movq	%r15, %rdi
	callq	_mutex_unlock
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_drm_gem_shmem_free_object      ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.comm	_SZ_2M,4,2                      ## @SZ_2M
	.comm	_DMA_BIDIRECTIONAL,4,2          ## @DMA_BIDIRECTIONAL
	.no_dead_strip	_panfrost_gem_free_object
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function panfrost_gem_free_object
_panfrost_gem_free_object:              ; @panfrost_gem_free_object
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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	x19, x0
	bl	_to_panfrost_bo
	mov	x21, x0
	ldr	x8, [x19]
	ldr	x20, [x8]
	ldr	x0, [x0, #8]
	cbz	x0, LBB0_7
; %bb.1:
	ldr	w8, [x21, #4]
Lloh0:
	adrp	x9, _SZ_2M@GOTPAGE
Lloh1:
	ldr	x9, [x9, _SZ_2M@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	sdiv	w8, w8, w9
	cmp	w8, #1
	b.lt	LBB0_6
; %bb.2:
	mov	x22, #0
	lsl	x23, x8, #4
Lloh3:
	adrp	x24, _DMA_BIDIRECTIONAL@GOTPAGE
Lloh4:
	ldr	x24, [x24, _DMA_BIDIRECTIONAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	ldr	x0, [x21, #8]
	add	x22, x22, #16
	cmp	x23, x22
	b.eq	LBB0_6
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	add	x8, x0, x22
	ldr	x1, [x8, #8]
	cbz	x1, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x20, #4]
	ldr	w2, [x0, x22]
	ldr	w3, [x24]
	mov	x0, x8
	bl	_dma_unmap_sg
	ldr	x8, [x21, #8]
	add	x0, x8, x22
	bl	_sg_free_table
	b	LBB0_3
LBB0_6:
	bl	_kfree
LBB0_7:
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x21
	bl	_list_empty
	cbnz	w0, LBB0_9
; %bb.8:
	mov	x0, x21
	bl	_list_del
LBB0_9:
	mov	x0, x20
	bl	_mutex_unlock
	mov	x0, x19
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	b	_drm_gem_shmem_free_object
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_SZ_2M,4,2                      ; @SZ_2M
	.comm	_DMA_BIDIRECTIONAL,4,2          ; @DMA_BIDIRECTIONAL
	.no_dead_strip	_panfrost_gem_free_object
.subsections_via_symbols
