	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc4_get_cache_list_for_size
_vc4_get_cache_list_for_size:           ## @vc4_get_cache_list_for_size
	.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	%rsi, %rbx
	callq	_to_vc4_dev
	movq	%rax, %r13
	movq	%rbx, %rdi
	callq	_bo_page_index
	movl	%eax, %r15d
	movl	(%r13), %edi
	cmpl	%eax, %edi
	jle	LBB0_2
## %bb.1:
	movq	8(%r13), %r12
	jmp	LBB0_12
LBB0_2:
	addl	%edi, %edi
	leal	1(%r15), %esi
	callq	_max
	movl	%eax, %edi
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%edi, -44(%rbp)                 ## 4-byte Spill
	movl	$4, %esi
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_3
## %bb.4:
	movq	%rax, %r12
	movl	(%r13), %eax
	testl	%eax, %eax
	jle	LBB0_8
## %bb.5:
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	xorl	%r15d, %r15d
	xorl	%r14d, %r14d
	jmp	LBB0_6
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rdi
	callq	_list_replace
LBB0_15:                                ##   in Loop: Header=BB0_6 Depth=1
	incq	%r14
	movslq	(%r13), %rax
	addq	$4, %r15
	cmpq	%rax, %r14
	jge	LBB0_16
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	8(%r13), %rbx
	addq	%r15, %rbx
	movq	%rbx, %rdi
	callq	_list_empty
	leaq	(%r12,%r15), %rsi
	testq	%rax, %rax
	je	LBB0_14
## %bb.7:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rsi, %rdi
	callq	_INIT_LIST_HEAD
	jmp	LBB0_15
LBB0_16:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
LBB0_8:
	cmpl	-44(%rbp), %eax                 ## 4-byte Folded Reload
	jge	LBB0_11
## %bb.9:
	movslq	%eax, %rcx
	leaq	(%r12,%rcx,4), %rbx
	movl	-44(%rbp), %r14d                ## 4-byte Reload
	subl	%eax, %r14d
	.p2align	4, 0x90
LBB0_10:                                ## =>This Inner Loop Header: Depth=1
	movq	%rbx, %rdi
	callq	_INIT_LIST_HEAD
	addq	$4, %rbx
	decl	%r14d
	jne	LBB0_10
LBB0_11:
	movq	8(%r13), %rdi
	callq	_kfree
	movq	%r12, 8(%r13)
	movl	-44(%rbp), %eax                 ## 4-byte Reload
	movl	%eax, (%r13)
LBB0_12:
	movslq	%r15d, %rax
	leaq	(%r12,%rax,4), %rax
LBB0_13:
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	xorl	%eax, %eax
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_vc4_get_cache_list_for_size
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc4_get_cache_list_for_size
_vc4_get_cache_list_for_size:           ; @vc4_get_cache_list_for_size
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #32]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #48]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #64]             ; 16-byte Folded Spill
	add	x29, sp, #64
	.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	x19, x1
	bl	_to_vc4_dev
	mov	x20, x0
	mov	x0, x19
	bl	_bo_page_index
	mov	x19, x0
	ldr	w8, [x20]
	cmp	w8, w0
	b.le	LBB0_2
; %bb.1:
	ldr	x22, [x20, #8]
	b	LBB0_13
LBB0_2:
	lsl	w0, w8, #1
	add	w1, w19, #1
	bl	_max
	mov	x21, x0
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	w1, #4
	bl	_kmalloc_array
	cbz	x0, LBB0_14
; %bb.3:
	mov	x22, x0
	ldr	w8, [x20]
	cmp	w8, #1
	b.lt	LBB0_9
; %bb.4:
	mov	x24, #0
	mov	x25, #0
	b	LBB0_7
LBB0_5:                                 ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x23
	bl	_list_replace
LBB0_6:                                 ;   in Loop: Header=BB0_7 Depth=1
	add	x25, x25, #1
	ldrsw	x8, [x20]
	add	x24, x24, #4
	cmp	x25, x8
	b.ge	LBB0_9
LBB0_7:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x20, #8]
	add	x23, x8, x24
	mov	x0, x23
	bl	_list_empty
	add	x1, x22, x24
	cbz	x0, LBB0_5
; %bb.8:                                ;   in Loop: Header=BB0_7 Depth=1
	mov	x0, x1
	bl	_INIT_LIST_HEAD
	b	LBB0_6
LBB0_9:
	cmp	w8, w21
	b.ge	LBB0_12
; %bb.10:
	add	x23, x22, w8, sxtw #2
	sub	w24, w21, w8
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	mov	x0, x23
	bl	_INIT_LIST_HEAD
	add	x23, x23, #4
	subs	w24, w24, #1
	b.ne	LBB0_11
LBB0_12:
	ldr	x0, [x20, #8]
	bl	_kfree
	str	x22, [x20, #8]
	str	w21, [x20]
LBB0_13:
	add	x0, x22, w19, sxtw #2
LBB0_14:
	ldp	x29, x30, [sp, #64]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #48]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #32]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.no_dead_strip	_vc4_get_cache_list_for_size
.subsections_via_symbols
