	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_bo_device_release          ## -- Begin function ttm_bo_device_release
	.p2align	4, 0x90
_ttm_bo_device_release:                 ## @ttm_bo_device_release
	.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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %r12
	movq	_TTM_NUM_MEM_TYPES@GOTPCREL(%rip), %rax
	movl	(%rax), %ebx
	movq	32(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	testl	%ebx, %ebx
	je	LBB0_1
## %bb.2:
	decl	%ebx
	leaq	(,%rbx,4), %rax
	leaq	(%rax,%rax,2), %r15
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
	movq	_TTM_PL_SYSTEM@GOTPCREL(%rip), %r13
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_7:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, (%r14,%r15)
LBB0_8:                                 ##   in Loop: Header=BB0_3 Depth=1
	addq	$-12, %r15
	addl	$-1, %ebx
	jae	LBB0_9
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r12), %r14
	cmpl	$0, (%r14,%r15)
	je	LBB0_8
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	$0, 4(%r14,%r15)
	cmpl	(%r13), %ebx
	je	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	movq	%r12, %rdi
	movl	%ebx, %esi
	callq	_ttm_bo_clean_mm
	testq	%rax, %rax
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_3 Depth=1
	xorl	%eax, %eax
	movq	_EBUSY@GOTPCREL(%rip), %rcx
	subl	(%rcx), %eax
	movl	%eax, -44(%rbp)                 ## 4-byte Spill
	leaq	L_.str(%rip), %rdi
	movl	%ebx, %esi
	callq	_pr_err
	jmp	LBB0_7
LBB0_1:
	movl	$0, -44(%rbp)                   ## 4-byte Folded Spill
LBB0_9:
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	leaq	4(%r14), %rbx
	movq	%rbx, %rdi
	callq	_mutex_lock
	leaq	24(%r12), %rdi
	callq	_list_del
	movq	%rbx, %rdi
	callq	_mutex_unlock
	leaq	20(%r12), %rdi
	callq	_cancel_delayed_work_sync
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_ttm_bo_delayed_delete
	testq	%rax, %rax
	jne	LBB0_10
## %bb.11:
	movq	%r14, %rdi
	callq	_spin_lock
	leaq	16(%r12), %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_13
## %bb.12:
	leaq	L_.str.1(%rip), %rdi
	callq	_TTM_DEBUG
LBB0_13:
	movq	8(%r12), %rdi
	addq	$8, %rdi
	callq	_list_empty
	testq	%rax, %rax
	je	LBB0_15
## %bb.14:
	leaq	L_.str.2(%rip), %rdi
	callq	_TTM_DEBUG
LBB0_15:
	movq	%r14, %rdi
	callq	_spin_unlock
	leaq	4(%r12), %rbx
	movq	%rbx, %rdi
	callq	_drm_mm_clean
	xorl	%edi, %edi
	testl	%eax, %eax
	sete	%dil
	callq	_BUG_ON
	movq	%r12, %rdi
	callq	_write_lock
	movq	%rbx, %rdi
	callq	_drm_mm_takedown
	movq	%r12, %rdi
	callq	_write_unlock
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_TTM_NUM_MEM_TYPES,4,2          ## @TTM_NUM_MEM_TYPES
	.comm	_TTM_PL_SYSTEM,4,2              ## @TTM_PL_SYSTEM
	.comm	_EBUSY,4,2                      ## @EBUSY
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DRM memory manager type %d is not clean\n"

L_.str.1:                               ## @.str.1
	.asciz	"Delayed destroy list was clean\n"

L_.str.2:                               ## @.str.2
	.asciz	"Swap list was clean\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_ttm_bo_device_release          ; -- Begin function ttm_bo_device_release
	.p2align	2
_ttm_bo_device_release:                 ; @ttm_bo_device_release
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x19, x0
Lloh0:
	adrp	x8, _TTM_NUM_MEM_TYPES@GOTPAGE
Lloh1:
	ldr	x8, [x8, _TTM_NUM_MEM_TYPES@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	ldr	x21, [x0, #32]
	mov	w20, #0
	cbz	w8, LBB0_8
; %bb.1:
	sub	w22, w8, #1
	mov	w8, #12
	umull	x24, w22, w8
Lloh3:
	adrp	x25, _TTM_PL_SYSTEM@GOTPAGE
Lloh4:
	ldr	x25, [x25, _TTM_PL_SYSTEM@GOTPAGEOFF]
Lloh5:
	adrp	x26, _EBUSY@GOTPAGE
Lloh6:
	ldr	x26, [x26, _EBUSY@GOTPAGEOFF]
Lloh7:
	adrp	x23, l_.str@PAGE
Lloh8:
	add	x23, x23, l_.str@PAGEOFF
	b	LBB0_4
LBB0_2:                                 ;   in Loop: Header=BB0_4 Depth=1
	str	wzr, [x27, x24]
LBB0_3:                                 ;   in Loop: Header=BB0_4 Depth=1
	sub	x24, x24, #12
	sub	w22, w22, #1
	cmn	w22, #1
	b.eq	LBB0_8
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x27, [x19, #8]
	ldr	w8, [x27, x24]
	cbz	w8, LBB0_3
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x8, x27, x24
	str	wzr, [x8, #4]
	ldr	w8, [x25]
	cmp	w22, w8
	b.eq	LBB0_2
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x19
	mov	x1, x22
	bl	_ttm_bo_clean_mm
	cbz	x0, LBB0_2
; %bb.7:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x26]
	neg	w20, w8
	mov	x0, x23
	mov	x1, x22
	bl	_pr_err
	b	LBB0_2
LBB0_8:
	add	x22, x21, #4
	mov	x0, x22
	bl	_mutex_lock
	add	x0, x19, #24
	bl	_list_del
	mov	x0, x22
	bl	_mutex_unlock
	add	x0, x19, #20
	bl	_cancel_delayed_work_sync
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x19
	mov	w1, #1
	bl	_ttm_bo_delayed_delete
	cbnz	x0, LBB0_9
; %bb.10:
	mov	x0, x21
	bl	_spin_lock
	add	x0, x19, #16
	bl	_list_empty
	cbz	x0, LBB0_12
; %bb.11:
Lloh9:
	adrp	x0, l_.str.1@PAGE
Lloh10:
	add	x0, x0, l_.str.1@PAGEOFF
	bl	_TTM_DEBUG
LBB0_12:
	ldr	x8, [x19, #8]
	add	x0, x8, #8
	bl	_list_empty
	cbz	x0, LBB0_14
; %bb.13:
Lloh11:
	adrp	x0, l_.str.2@PAGE
Lloh12:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_TTM_DEBUG
LBB0_14:
	mov	x0, x21
	bl	_spin_unlock
	add	x21, x19, #4
	mov	x0, x21
	bl	_drm_mm_clean
	cmp	w0, #0
	cset	w0, eq
	bl	_BUG_ON
	mov	x0, x19
	bl	_write_lock
	mov	x0, x21
	bl	_drm_mm_takedown
	mov	x0, x19
	bl	_write_unlock
	mov	x0, x20
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.cfi_endproc
                                        ; -- End function
	.comm	_TTM_NUM_MEM_TYPES,4,2          ; @TTM_NUM_MEM_TYPES
	.comm	_TTM_PL_SYSTEM,4,2              ; @TTM_PL_SYSTEM
	.comm	_EBUSY,4,2                      ; @EBUSY
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DRM memory manager type %d is not clean\n"

l_.str.1:                               ; @.str.1
	.asciz	"Delayed destroy list was clean\n"

l_.str.2:                               ; @.str.2
	.asciz	"Swap list was clean\n"

.subsections_via_symbols
