	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttm_bo_cleanup_refs_and_unlock
_ttm_bo_cleanup_refs_and_unlock:        ## @ttm_bo_cleanup_refs_and_unlock
	.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
	movl	%edx, %r14d
	movl	%esi, -44(%rbp)                 ## 4-byte Spill
	movq	%rdi, %r15
	movq	16(%rdi), %rax
	movq	%rax, -56(%rbp)                 ## 8-byte Spill
	movq	24(%rdi), %r12
	movq	8(%r12), %r13
	movq	%r12, %rdi
	callq	_spin_lock
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_ttm_bo_wait
	movl	%eax, %ebx
	testl	%r14d, %r14d
	jne	LBB0_6
## %bb.1:
	testl	%ebx, %ebx
	je	LBB0_6
## %bb.2:
	movl	12(%r15), %edi
	callq	*16(%r13)
	movq	%rax, %rbx
	movq	%rax, -64(%rbp)
	movq	%r12, %rdi
	callq	_spin_unlock
	leaq	8(%r15), %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	leaq	4(%r15), %rdi
	callq	_wake_up_all
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	%rbx, %rdi
	xorl	%esi, %esi
	movl	-44(%rbp), %edx                 ## 4-byte Reload
	callq	*(%r13)
	movl	%eax, %ebx
	leaq	-64(%rbp), %rdi
	callq	*8(%r13)
	testl	%ebx, %ebx
	jne	LBB0_10
## %bb.3:
	movq	%r12, %rdi
	callq	_spin_lock
	movq	%r15, %rdi
	xorl	%esi, %esi
	xorl	%edx, %edx
	movl	$1, %ecx
	callq	_ttm_bo_wait
	movl	%eax, %ebx
	movl	%eax, %edi
	callq	_WARN_ON
	movq	%r12, %rdi
	callq	_spin_unlock
	testl	%ebx, %ebx
	jne	LBB0_10
## %bb.4:
	movq	%r14, %rdi
	callq	_spin_lock
	xorl	%ebx, %ebx
	movq	%r15, %rdi
	xorl	%esi, %esi
	movl	$1, %edx
	xorl	%ecx, %ecx
	xorl	%r8d, %r8d
	callq	_ttm_bo_reserve_nolru
	testl	%eax, %eax
	jne	LBB0_5
	jmp	LBB0_7
LBB0_6:
	movq	%r12, %rdi
	callq	_spin_unlock
	testl	%ebx, %ebx
	movq	-56(%rbp), %r14                 ## 8-byte Reload
	jne	LBB0_8
LBB0_7:
	movq	%r15, %rdi
	callq	_list_empty
	movl	%eax, %edi
	callq	_unlikely
	xorl	%ebx, %ebx
	testq	%rax, %rax
	je	LBB0_9
LBB0_8:
	leaq	8(%r15), %rdi
	xorl	%esi, %esi
	callq	_atomic_set
	addq	$4, %r15
	movq	%r15, %rdi
	callq	_wake_up_all
LBB0_5:
	movq	%r14, %rdi
	callq	_spin_unlock
LBB0_10:
	movl	%ebx, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_9:
	movq	%r15, %rdi
	callq	_ttm_bo_del_from_lru
	movl	%eax, %ebx
	movq	%r15, %rdi
	callq	_list_del_init
	incl	%ebx
	movq	%r14, %rdi
	callq	_spin_unlock
	movq	%r15, %rdi
	callq	_ttm_bo_cleanup_memtype_use
	movq	%r15, %rdi
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_ttm_bo_list_ref_sub
	xorl	%ebx, %ebx
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.no_dead_strip	_ttm_bo_cleanup_refs_and_unlock
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ttm_bo_cleanup_refs_and_unlock
_ttm_bo_cleanup_refs_and_unlock:        ; @ttm_bo_cleanup_refs_and_unlock
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.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
	mov	x24, x2
	mov	x23, x1
	mov	x19, x0
	ldp	x20, x21, [x0, #16]
	ldr	x25, [x21, #8]
	mov	x0, x21
	bl	_spin_lock
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w3, #1
	bl	_ttm_bo_wait
	mov	x22, x0
	cbnz	w24, LBB0_6
; %bb.1:
	cbz	w22, LBB0_6
; %bb.2:
	ldr	x8, [x25, #16]
	ldr	w0, [x19, #12]
	blr	x8
	mov	x22, x0
	str	x0, [sp, #8]
	mov	x0, x21
	bl	_spin_unlock
	add	x0, x19, #8
	mov	w1, #0
	bl	_atomic_set
	add	x0, x19, #4
	bl	_wake_up_all
	mov	x0, x20
	bl	_spin_unlock
	ldr	x8, [x25]
	mov	x0, x22
	mov	w1, #0
	mov	x2, x23
	blr	x8
	mov	x22, x0
	ldr	x8, [x25, #8]
	add	x0, sp, #8
	blr	x8
	cbnz	w22, LBB0_12
; %bb.3:
	mov	x0, x21
	bl	_spin_lock
	mov	x0, x19
	mov	w1, #0
	mov	w2, #0
	mov	w3, #1
	bl	_ttm_bo_wait
	mov	x22, x0
	bl	_WARN_ON
	mov	x0, x21
	bl	_spin_unlock
	cbnz	w22, LBB0_12
; %bb.4:
	mov	x0, x20
	bl	_spin_lock
	mov	x0, x19
	mov	w1, #0
	mov	w2, #1
	mov	w3, #0
	mov	w4, #0
	bl	_ttm_bo_reserve_nolru
	cbz	w0, LBB0_7
; %bb.5:
	mov	x0, x20
	bl	_spin_unlock
	b	LBB0_11
LBB0_6:
	mov	x0, x21
	bl	_spin_unlock
	cbnz	w22, LBB0_9
LBB0_7:
	mov	x0, x19
	bl	_list_empty
	bl	_unlikely
	cbz	x0, LBB0_10
; %bb.8:
	mov	w22, #0
LBB0_9:
	add	x0, x19, #8
	mov	w1, #0
	bl	_atomic_set
	add	x0, x19, #4
	bl	_wake_up_all
	mov	x0, x20
	bl	_spin_unlock
	b	LBB0_12
LBB0_10:
	mov	x0, x19
	bl	_ttm_bo_del_from_lru
	mov	x21, x0
	mov	x0, x19
	bl	_list_del_init
	add	w21, w21, #1
	mov	x0, x20
	bl	_spin_unlock
	mov	x0, x19
	bl	_ttm_bo_cleanup_memtype_use
	mov	x0, x19
	mov	x1, x21
	mov	w2, #1
	bl	_ttm_bo_list_ref_sub
LBB0_11:
	mov	w22, #0
LBB0_12:
	mov	x0, x22
	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
	add	sp, sp, #96
	ret
	.cfi_endproc
                                        ; -- End function
	.no_dead_strip	_ttm_bo_cleanup_refs_and_unlock
.subsections_via_symbols
