	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_sa_bo_free              ## -- Begin function radeon_sa_bo_free
	.p2align	4, 0x90
_radeon_sa_bo_free:                     ## @radeon_sa_bo_free
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.1:
	movq	%rsi, %rbx
	movq	(%rsi), %rax
	testq	%rax, %rax
	je	LBB0_7
## %bb.2:
	movq	%rdx, %r15
	movq	8(%rax), %r14
	movq	%r14, %rdi
	callq	_spin_lock
	testq	%r15, %r15
	je	LBB0_5
## %bb.3:
	movq	%r15, %rdi
	callq	_radeon_fence_signaled
	testl	%eax, %eax
	je	LBB0_4
LBB0_5:
	movq	(%rbx), %rdi
	callq	_radeon_sa_bo_remove_locked
	jmp	LBB0_6
LBB0_4:
	movq	%r15, %rdi
	callq	_radeon_fence_ref
	movq	(%rbx), %rdi
	movl	%eax, 4(%rdi)
	movq	(%r15), %rsi
	shlq	$2, %rsi
	addq	8(%r14), %rsi
	callq	_list_add_tail
LBB0_6:
	movq	%r14, %rdi
	callq	_wake_up_all_locked
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	$0, (%rbx)
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_radeon_sa_bo_free              ; -- Begin function radeon_sa_bo_free
	.p2align	2
_radeon_sa_bo_free:                     ; @radeon_sa_bo_free
	.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
	cbz	x1, LBB0_7
; %bb.1:
	mov	x19, x1
	ldr	x8, [x1]
	cbz	x8, LBB0_7
; %bb.2:
	mov	x21, x2
	ldr	x20, [x8, #8]
	mov	x0, x20
	bl	_spin_lock
	cbz	x21, LBB0_4
; %bb.3:
	mov	x0, x21
	bl	_radeon_fence_signaled
	cbz	w0, LBB0_5
LBB0_4:
	ldr	x0, [x19]
	bl	_radeon_sa_bo_remove_locked
	b	LBB0_6
LBB0_5:
	mov	x0, x21
	bl	_radeon_fence_ref
	ldr	x8, [x19]
	str	w0, [x8, #4]
	ldr	x9, [x20, #8]
	ldr	x10, [x21]
	add	x1, x9, x10, lsl #2
	mov	x0, x8
	bl	_list_add_tail
LBB0_6:
	mov	x0, x20
	bl	_wake_up_all_locked
	mov	x0, x20
	bl	_spin_unlock
	str	xzr, [x19]
LBB0_7:
	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
	ret
	.cfi_endproc
                                        ; -- End function
.subsections_via_symbols
