	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function amdgpu_bo_destroy
_amdgpu_bo_destroy:                     ## @amdgpu_bo_destroy
	.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
	movq	%rdi, %rbx
	movl	(%rdi), %edi
	callq	_amdgpu_ttm_adev
	movq	%rax, %r14
	movq	%rbx, %rdi
	callq	_ttm_to_amdgpu_bo
	movq	%rax, %rbx
	cmpq	$0, (%rax)
	jle	LBB0_2
## %bb.1:
	movq	%rbx, %rdi
	callq	_amdgpu_bo_subtract_pin_size
LBB0_2:
	movq	%rbx, %rdi
	callq	_amdgpu_bo_kunmap
	leaq	24(%rbx), %r15
	cmpq	$0, 24(%rbx)
	je	LBB0_4
## %bb.3:
	movl	32(%rbx), %esi
	movq	%r15, %rdi
	callq	_drm_prime_gem_destroy
LBB0_4:
	movq	%r15, %rdi
	callq	_drm_gem_object_release
	leaq	20(%rbx), %r15
	movq	%r15, %rdi
	callq	_list_empty
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:
	movq	%r14, %rdi
	callq	_mutex_lock
	movq	%r15, %rdi
	callq	_list_del_init
	movq	%r14, %rdi
	callq	_mutex_unlock
LBB0_6:
	movq	%rbx, %rdi
	addq	$16, %rdi
	callq	_amdgpu_bo_unref
	movq	8(%rbx), %rdi
	callq	_kfree
	movq	%rbx, %rdi
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_kfree                          ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_amdgpu_bo_destroy
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function amdgpu_bo_destroy
_amdgpu_bo_destroy:                     ; @amdgpu_bo_destroy
	.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	x19, x0
	ldr	w0, [x0]
	bl	_amdgpu_ttm_adev
	mov	x20, x0
	mov	x0, x19
	bl	_ttm_to_amdgpu_bo
	mov	x19, x0
	ldr	x8, [x0]
	cmp	x8, #1
	b.lt	LBB0_2
; %bb.1:
	mov	x0, x19
	bl	_amdgpu_bo_subtract_pin_size
LBB0_2:
	mov	x0, x19
	bl	_amdgpu_bo_kunmap
	mov	x21, x19
	ldr	x8, [x21, #24]!
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w1, [x19, #32]
	mov	x0, x21
	bl	_drm_prime_gem_destroy
LBB0_4:
	mov	x0, x21
	bl	_drm_gem_object_release
	add	x21, x19, #20
	mov	x0, x21
	bl	_list_empty
	cbnz	w0, LBB0_6
; %bb.5:
	mov	x0, x20
	bl	_mutex_lock
	mov	x0, x21
	bl	_list_del_init
	mov	x0, x20
	bl	_mutex_unlock
LBB0_6:
	add	x0, x19, #16
	bl	_amdgpu_bo_unref
	ldr	x0, [x19, #8]
	bl	_kfree
	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
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_amdgpu_bo_destroy
.subsections_via_symbols
