	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function vc4_dlist_write
_vc4_dlist_write:                       ## @vc4_dlist_write
	.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	%rsi, %r14
	movq	%rdi, %rbx
	movl	(%rdi), %esi
	cmpl	4(%rdi), %esi
	jne	LBB0_1
## %bb.2:
	addl	%esi, %esi
	movl	$4, %edi
                                        ## kill: def $esi killed $esi killed $rsi
	callq	_max
	movq	%rax, %r12
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	%r12, %rdi
	movl	$4, %esi
	callq	_kmalloc_array
	testq	%rax, %rax
	je	LBB0_5
## %bb.3:
	movq	%rax, %r15
	movq	8(%rbx), %rsi
	movl	(%rbx), %edx
	shll	$2, %edx
	movq	%rax, %rdi
	callq	_memcpy
	movq	8(%rbx), %rdi
	callq	_kfree
	movq	%r15, 8(%rbx)
	movl	%r12d, 4(%rbx)
	movl	(%rbx), %esi
	jmp	LBB0_4
LBB0_1:
	movq	8(%rbx), %r15
LBB0_4:
	leal	1(%rsi), %eax
	movl	%eax, (%rbx)
	movslq	%esi, %rax
	movq	%r14, (%r15,%rax,8)
LBB0_5:
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.no_dead_strip	_vc4_dlist_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function vc4_dlist_write
_vc4_dlist_write:                       ; @vc4_dlist_write
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x19, x1
	mov	x20, x0
	ldp	w8, w9, [x0]
	cmp	w8, w9
	b.ne	LBB0_3
; %bb.1:
	lsl	w1, w8, #1
	mov	w0, #4
	bl	_max
	mov	x22, 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_5
; %bb.2:
	mov	x21, x0
	ldr	x1, [x20, #8]
	ldr	w8, [x20]
	lsl	w2, w8, #2
	bl	_memcpy
	ldr	x0, [x20, #8]
	bl	_kfree
	str	x21, [x20, #8]
	str	w22, [x20, #4]
	ldr	w8, [x20]
	b	LBB0_4
LBB0_3:
	ldr	x21, [x20, #8]
LBB0_4:
	add	w9, w8, #1
	str	w9, [x20]
	str	x19, [x21, w8, sxtw #3]
LBB0_5:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 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_dlist_write
.subsections_via_symbols
