	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ttm_pool_shrink_scan
_ttm_pool_shrink_scan:                  ## @ttm_pool_shrink_scan
	.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	$40, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, -56(%rbp)                 ## 8-byte Spill
	movl	(%rsi), %r12d
	leaq	_ttm_pool_shrink_scan.lock(%rip), %rdi
	callq	_mutex_trylock
	testl	%eax, %eax
	je	LBB0_1
## %bb.2:
	movl	_ttm_pool_shrink_scan.start_pool(%rip), %eax
	incl	%eax
	movl	%eax, _ttm_pool_shrink_scan.start_pool(%rip)
	movq	_NUM_POOLS@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	xorl	%ebx, %ebx
	xorl	%edx, %edx
	divl	%ecx
                                        ## kill: def $edx killed $edx def $rdx
	movq	%rdx, -48(%rbp)                 ## 8-byte Spill
	testl	%ecx, %ecx
	je	LBB0_8
## %bb.3:
	testl	%r12d, %r12d
	je	LBB0_8
## %bb.4:
	xorl	%edx, %edx
	movl	$1, %r15d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	movq	%rbx, -80(%rbp)                 ## 8-byte Spill
	movq	__manager@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %r14
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	addl	%edx, %eax
	xorl	%edx, %edx
	divl	%ecx
	movl	%edx, %r13d
	leaq	(%r14,%r13,4), %rax
	movq	%rax, -72(%rbp)                 ## 8-byte Spill
	movzbl	(%r14,%r13,4), %ecx
	movl	$1, %esi
	shll	%cl, %esi
	movl	%r12d, %edi
	callq	_roundup
	movl	%eax, %ebx
	movzbl	(%r14,%r13,4), %ecx
	shrl	%cl, %ebx
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	%ebx, %esi
	movl	$1, %edx
	callq	_ttm_page_pool_free
	movl	%eax, %r12d
	subl	%eax, %ebx
	movl	(%r14,%r13,4), %ecx
	shll	%cl, %ebx
	addq	-80(%rbp), %rbx                 ## 8-byte Folded Reload
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movslq	(%rax), %rax
	cmpq	%rax, %rbx
	jae	LBB0_8
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
                                        ## kill: def $cl killed $cl killed $ecx
	shll	%cl, %r12d
	movq	_NUM_POOLS@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	cmpl	%ecx, %r15d
	jae	LBB0_8
## %bb.7:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	incl	%edx
	incl	%r15d
	testl	%r12d, %r12d
	jne	LBB0_5
LBB0_8:
	leaq	_ttm_pool_shrink_scan.lock(%rip), %rdi
	callq	_mutex_unlock
	jmp	LBB0_9
LBB0_1:
	movq	_SHRINK_STOP@GOTPCREL(%rip), %rax
	movq	(%rax), %rbx
LBB0_9:
	movq	%rbx, %rax
	addq	$40, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_ttm_pool_shrink_scan.lock,4,2 ## @ttm_pool_shrink_scan.lock
.zerofill __DATA,__bss,_ttm_pool_shrink_scan.start_pool,4,2 ## @ttm_pool_shrink_scan.start_pool
	.comm	_SHRINK_STOP,8,3                ## @SHRINK_STOP
	.comm	_NUM_POOLS,4,2                  ## @NUM_POOLS
	.comm	__manager,8,3                   ## @_manager
	.no_dead_strip	_ttm_pool_shrink_scan
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ttm_pool_shrink_scan
_ttm_pool_shrink_scan:                  ; @ttm_pool_shrink_scan
	.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	x20, x1
	ldr	w21, [x1]
Lloh0:
	adrp	x0, _ttm_pool_shrink_scan.lock@PAGE
Lloh1:
	add	x0, x0, _ttm_pool_shrink_scan.lock@PAGEOFF
	bl	_mutex_trylock
	cbz	w0, LBB0_8
; %bb.1:
	mov	x19, #0
	adrp	x8, _ttm_pool_shrink_scan.start_pool@PAGE
	ldr	w9, [x8, _ttm_pool_shrink_scan.start_pool@PAGEOFF]
	add	w9, w9, #1
	str	w9, [x8, _ttm_pool_shrink_scan.start_pool@PAGEOFF]
Lloh2:
	adrp	x23, _NUM_POOLS@GOTPAGE
Lloh3:
	ldr	x23, [x23, _NUM_POOLS@GOTPAGEOFF]
	ldr	w8, [x23]
	cbz	w8, LBB0_7
; %bb.2:
	cbz	w21, LBB0_7
; %bb.3:
	mov	w24, #0
	mov	x19, #0
	udiv	w10, w9, w8
	msub	w25, w10, w8, w9
	mov	w26, #1
Lloh4:
	adrp	x27, __manager@GOTPAGE
Lloh5:
	ldr	x27, [x27, __manager@GOTPAGEOFF]
	mov	w28, #1
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x9, [x27]
	ldr	x9, [x9]
	add	w10, w24, w25
	udiv	w11, w10, w8
	msub	w8, w11, w8, w10
	add	x22, x9, w8, uxtw #2
	ldr	w8, [x22]
	lsl	w1, w26, w8
	mov	x0, x21
	bl	_roundup
	ldr	w8, [x22]
	lsr	w21, w0, w8
	mov	x0, x22
	mov	x1, x21
	mov	w2, #1
	bl	_ttm_page_pool_free
	sub	w8, w21, w0
	ldr	w9, [x22]
	lsl	w8, w8, w9
	ldrsw	x10, [x20]
	add	x19, x19, x8
	cmp	x19, x10
	b.hs	LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x23]
	cmp	w28, w8
	b.hs	LBB0_7
; %bb.6:                                ;   in Loop: Header=BB0_4 Depth=1
	lsl	w21, w0, w9
	add	w24, w24, #1
	add	w28, w28, #1
	cbnz	w21, LBB0_4
LBB0_7:
Lloh6:
	adrp	x0, _ttm_pool_shrink_scan.lock@PAGE
Lloh7:
	add	x0, x0, _ttm_pool_shrink_scan.lock@PAGEOFF
	bl	_mutex_unlock
	b	LBB0_9
LBB0_8:
Lloh8:
	adrp	x8, _SHRINK_STOP@GOTPAGE
Lloh9:
	ldr	x8, [x8, _SHRINK_STOP@GOTPAGEOFF]
Lloh10:
	ldr	x19, [x8]
LBB0_9:
	mov	x0, x19
	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 AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_ttm_pool_shrink_scan.lock,4,2 ; @ttm_pool_shrink_scan.lock
.zerofill __DATA,__bss,_ttm_pool_shrink_scan.start_pool,4,2 ; @ttm_pool_shrink_scan.start_pool
	.comm	_SHRINK_STOP,8,3                ; @SHRINK_STOP
	.comm	_NUM_POOLS,4,2                  ; @NUM_POOLS
	.comm	__manager,8,3                   ; @_manager
	.no_dead_strip	_ttm_pool_shrink_scan
.subsections_via_symbols
