	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cas_page_alloc
_cas_page_alloc:                        ## @cas_page_alloc
	.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	%rbx
	pushq	%rax
	.cfi_offset %rbx, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%esi, %r15d
	movq	%rdi, %r14
	movl	$12, %edi
	callq	_kmalloc
	testq	%rax, %rax
	je	LBB0_4
## %bb.1:
	movq	%rax, %rbx
	movq	%rax, %rdi
	addq	$8, %rdi
	callq	_INIT_LIST_HEAD
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_RX_USED_SET
	movl	8(%r14), %esi
	movl	%r15d, %edi
	callq	_alloc_pages
	movl	%eax, (%rbx)
	testl	%eax, %eax
	je	LBB0_3
## %bb.2:
	movl	(%r14), %ecx
	movl	4(%r14), %edi
	movq	_PCI_DMA_FROMDEVICE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %r8d
	movl	%eax, %esi
	xorl	%edx, %edx
	callq	_pci_map_page
	movl	%eax, 4(%rbx)
	jmp	LBB0_5
LBB0_3:
	movq	%rbx, %rdi
	callq	_kfree
LBB0_4:
	xorl	%ebx, %ebx
LBB0_5:
	movq	%rbx, %rax
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PCI_DMA_FROMDEVICE,4,2         ## @PCI_DMA_FROMDEVICE
	.no_dead_strip	_cas_page_alloc
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cas_page_alloc
_cas_page_alloc:                        ; @cas_page_alloc
	.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	x21, x1
	mov	x20, x0
	mov	w0, #12
	bl	_kmalloc
	mov	x19, x0
	cbz	x0, LBB0_4
; %bb.1:
	add	x0, x19, #8
	bl	_INIT_LIST_HEAD
	mov	x0, x19
	mov	w1, #0
	bl	_RX_USED_SET
	ldr	w1, [x20, #8]
	mov	x0, x21
	bl	_alloc_pages
	str	w0, [x19]
	cbz	w0, LBB0_3
; %bb.2:
	mov	x1, x0
	ldp	w3, w0, [x20]
Lloh0:
	adrp	x8, _PCI_DMA_FROMDEVICE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _PCI_DMA_FROMDEVICE@GOTPAGEOFF]
Lloh2:
	ldr	w4, [x8]
	mov	w2, #0
	bl	_pci_map_page
	str	w0, [x19, #4]
	b	LBB0_4
LBB0_3:
	mov	x0, x19
	bl	_kfree
	mov	x19, #0
LBB0_4:
	mov	x0, x19
	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	_PCI_DMA_FROMDEVICE,4,2         ; @PCI_DMA_FROMDEVICE
	.no_dead_strip	_cas_page_alloc
.subsections_via_symbols
