	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttm_bo_cleanup_refs_or_queue
_ttm_bo_cleanup_refs_or_queue:          ## @ttm_bo_cleanup_refs_or_queue
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, %rbx
	movq	32(%rdi), %r14
	movq	8(%r14), %r15
	callq	_ttm_bo_individualize_resv
	testl	%eax, %eax
	je	LBB0_2
## %bb.1:
	movq	16(%rbx), %rdi
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, %ecx
	shll	$5, %ecx
	subl	%eax, %ecx
	subl	%eax, %ecx
	movl	$1, %esi
	xorl	%edx, %edx
	callq	_dma_resv_wait_timeout_rcu
	movq	%r15, %rdi
	callq	_spin_lock
	jmp	LBB0_13
LBB0_2:
	movq	%r15, %rdi
	callq	_spin_lock
	leaq	8(%rbx), %r12
	movq	16(%rbx), %rdi
	callq	_dma_resv_trylock
	testq	%rax, %rax
	jne	LBB0_4
## %bb.3:
	movq	_EBUSY@GOTPCREL(%rip), %rax
	cmpl	$0, (%rax)
	je	LBB0_4
## %bb.11:
	cmpq	%r12, 16(%rbx)
	je	LBB0_13
LBB0_12:
	movq	%r12, %rdi
	callq	_dma_resv_unlock
LBB0_13:
	leaq	4(%rbx), %rdi
	callq	_kref_get
	leaq	4(%r14), %rsi
	movq	%rbx, %rdi
	callq	_list_add_tail
	movq	%r15, %rdi
	callq	_spin_unlock
	movq	_HZ@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	$1, %esi
	cmpl	$100, %eax
	jl	LBB0_15
## %bb.14:
	cltq
	imulq	$1374389535, %rax, %rsi         ## imm = 0x51EB851F
	movq	%rsi, %rax
	shrq	$63, %rax
	sarq	$37, %rsi
	addl	%eax, %esi
LBB0_15:
	movq	%r14, %rdi
                                        ## kill: def $esi killed $esi killed $rsi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_schedule_delayed_work          ## TAILCALL
LBB0_4:
	movq	%r12, %rdi
	movl	$1, %esi
	callq	_dma_resv_test_signaled_rcu
	movq	%rbx, %rdi
	testq	%rax, %rax
	je	LBB0_8
## %bb.5:
	callq	_ttm_bo_del_from_lru
	movq	%r15, %rdi
	callq	_spin_unlock
	cmpq	%r12, 16(%rbx)
	je	LBB0_7
## %bb.6:
	movq	%r12, %rdi
	callq	_dma_resv_unlock
LBB0_7:
	movq	%rbx, %rdi
	callq	_ttm_bo_cleanup_memtype_use
	movq	16(%rbx), %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_dma_resv_unlock                ## TAILCALL
LBB0_8:
	callq	_ttm_bo_flush_all_fences
	movl	24(%rbx), %eax
	movq	_TTM_PL_FLAG_NO_EVICT@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	testl	%eax, %ecx
	je	LBB0_10
## %bb.9:
	notl	%ecx
	andl	%ecx, %eax
	movl	%eax, 24(%rbx)
	movq	%rbx, %rdi
	callq	_ttm_bo_add_to_lru
LBB0_10:
	movq	16(%rbx), %rdi
	callq	_dma_resv_unlock
	cmpq	%r12, 16(%rbx)
	jne	LBB0_12
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_HZ,4,2                         ## @HZ
	.comm	_EBUSY,4,2                      ## @EBUSY
	.comm	_TTM_PL_FLAG_NO_EVICT,4,2       ## @TTM_PL_FLAG_NO_EVICT
	.no_dead_strip	_ttm_bo_cleanup_refs_or_queue
.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_or_queue
_ttm_bo_cleanup_refs_or_queue:          ; @ttm_bo_cleanup_refs_or_queue
	.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
	ldr	x20, [x0, #32]
	ldr	x21, [x20, #8]
	bl	_ttm_bo_individualize_resv
Lloh0:
	adrp	x23, _HZ@GOTPAGE
Lloh1:
	ldr	x23, [x23, _HZ@GOTPAGEOFF]
	cbz	w0, LBB0_2
; %bb.1:
	ldr	x0, [x19, #16]
	ldr	w8, [x23]
	mov	w9, #30
	mul	w3, w8, w9
	mov	w1, #1
	mov	w2, #0
	bl	_dma_resv_wait_timeout_rcu
	mov	x0, x21
	bl	_spin_lock
	b	LBB0_12
LBB0_2:
	mov	x0, x21
	bl	_spin_lock
	add	x22, x19, #8
	ldr	x0, [x19, #16]
	bl	_dma_resv_trylock
Lloh2:
	adrp	x8, _EBUSY@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EBUSY@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	cmp	x0, #0
	ccmp	w8, #0, #4, eq
	b.ne	LBB0_10
; %bb.3:
	mov	x0, x22
	mov	w1, #1
	bl	_dma_resv_test_signaled_rcu
	cbz	x0, LBB0_7
; %bb.4:
	mov	x0, x19
	bl	_ttm_bo_del_from_lru
	mov	x0, x21
	bl	_spin_unlock
	ldr	x8, [x19, #16]
	cmp	x8, x22
	b.eq	LBB0_6
; %bb.5:
	mov	x0, x22
	bl	_dma_resv_unlock
LBB0_6:
	mov	x0, x19
	bl	_ttm_bo_cleanup_memtype_use
	ldr	x0, [x19, #16]
	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	_dma_resv_unlock
LBB0_7:
	mov	x0, x19
	bl	_ttm_bo_flush_all_fences
	ldr	w8, [x19, #24]
Lloh5:
	adrp	x9, _TTM_PL_FLAG_NO_EVICT@GOTPAGE
Lloh6:
	ldr	x9, [x9, _TTM_PL_FLAG_NO_EVICT@GOTPAGEOFF]
Lloh7:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_9
; %bb.8:
	bic	w8, w8, w9
	str	w8, [x19, #24]
	mov	x0, x19
	bl	_ttm_bo_add_to_lru
LBB0_9:
	ldr	x0, [x19, #16]
	bl	_dma_resv_unlock
LBB0_10:
	ldr	x8, [x19, #16]
	cmp	x8, x22
	b.eq	LBB0_12
; %bb.11:
	mov	x0, x22
	bl	_dma_resv_unlock
LBB0_12:
	add	x0, x19, #4
	bl	_kref_get
	add	x1, x20, #4
	mov	x0, x19
	bl	_list_add_tail
	mov	x0, x21
	bl	_spin_unlock
	ldrsw	x8, [x23]
	mov	w9, #34079
	movk	w9, #20971, lsl #16
	mul	x9, x8, x9
	lsr	x10, x9, #63
	asr	x9, x9, #37
	add	w9, w9, w10
	cmp	w8, #100
	csinc	w1, w9, wzr, ge
	mov	x0, x20
	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	_schedule_delayed_work
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.cfi_endproc
                                        ; -- End function
	.comm	_HZ,4,2                         ; @HZ
	.comm	_EBUSY,4,2                      ; @EBUSY
	.comm	_TTM_PL_FLAG_NO_EVICT,4,2       ; @TTM_PL_FLAG_NO_EVICT
	.no_dead_strip	_ttm_bo_cleanup_refs_or_queue
.subsections_via_symbols
