	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function via_lock_all_dma_pages
_via_lock_all_dma_pages:                ## @via_lock_all_dma_pages
	.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
	movq	%rsi, %rbx
	movq	%rdi, %r14
	movl	(%rsi), %edi
	callq	_VIA_PFN
	movq	%rax, %r15
	movl	(%rbx), %eax
	movl	8(%rbx), %ecx
	imull	4(%rbx), %ecx
	leal	(%rax,%rcx), %edi
	decl	%edi
	callq	_VIA_PFN
	subq	%r15, %rax
	leaq	1(%rax), %rsi
	movq	%rsi, (%r14)
	movl	$8, %edi
	callq	_array_size
	movl	%eax, %edi
	callq	_vzalloc
	movq	%rax, 24(%r14)
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movslq	(%rbx), %rdi
	movq	(%r14), %rsi
	movq	8(%r14), %rcx
	movq	_DMA_FROM_DEVICE@GOTPCREL(%rip), %rbx
	xorl	%edx, %edx
	cmpq	(%rbx), %rcx
	jne	LBB0_5
## %bb.4:
	movq	_FOLL_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
LBB0_5:
	movq	%rax, %rcx
	callq	_get_user_pages_fast
	movslq	%eax, %rcx
	cmpq	%rcx, (%r14)
	jne	LBB0_6
## %bb.8:
	movq	_dr_via_pages_locked@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r14)
	leaq	L_.str(%rip), %rdi
	callq	_DRM_DEBUG
	xorl	%eax, %eax
	jmp	LBB0_9
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	jmp	LBB0_2
LBB0_6:
	testl	%eax, %eax
	js	LBB0_9
## %bb.7:
	movq	_dr_via_pages_locked@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, 16(%r14)
	movq	_EINVAL@GOTPCREL(%rip), %rcx
LBB0_2:
	xorl	%eax, %eax
	subl	(%rcx), %eax
LBB0_9:
	addq	$8, %rsp
	popq	%rbx
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_FROM_DEVICE,8,3            ## @DMA_FROM_DEVICE
	.comm	_FOLL_WRITE,4,2                 ## @FOLL_WRITE
	.comm	_dr_via_pages_locked,8,3        ## @dr_via_pages_locked
	.comm	_EINVAL,4,2                     ## @EINVAL
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"DMA pages locked\n"

	.no_dead_strip	_via_lock_all_dma_pages
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function via_lock_all_dma_pages
_via_lock_all_dma_pages:                ; @via_lock_all_dma_pages
	.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	x20, x1
	mov	x19, x0
	ldr	w0, [x1]
	bl	_VIA_PFN
	mov	x21, x0
	ldp	w8, w9, [x20]
	ldr	w10, [x20, #8]
	madd	w8, w10, w9, w8
	sub	w0, w8, #1
	bl	_VIA_PFN
	sub	x8, x0, x21
	add	x1, x8, #1
	str	x1, [x19]
	mov	w0, #8
	bl	_array_size
	bl	_vzalloc
	str	x0, [x19, #24]
	cbz	x0, LBB0_3
; %bb.1:
	mov	x3, x0
	ldrsw	x0, [x20]
	ldp	x1, x8, [x19]
Lloh0:
	adrp	x9, _DMA_FROM_DEVICE@GOTPAGE
Lloh1:
	ldr	x9, [x9, _DMA_FROM_DEVICE@GOTPAGEOFF]
Lloh2:
	ldr	x9, [x9]
Lloh3:
	adrp	x10, _FOLL_WRITE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _FOLL_WRITE@GOTPAGEOFF]
Lloh5:
	ldr	w10, [x10]
	cmp	x8, x9
	csel	w2, w10, wzr, eq
	bl	_get_user_pages_fast
	ldr	x8, [x19]
	cmp	x8, w0, sxtw
	b.ne	LBB0_4
; %bb.2:
Lloh6:
	adrp	x8, _dr_via_pages_locked@GOTPAGE
Lloh7:
	ldr	x8, [x8, _dr_via_pages_locked@GOTPAGEOFF]
Lloh8:
	ldr	x8, [x8]
	str	x8, [x19, #16]
Lloh9:
	adrp	x0, l_.str@PAGE
Lloh10:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DRM_DEBUG
	mov	w0, #0
	b	LBB0_7
LBB0_3:
Lloh11:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_6
LBB0_4:
	tbnz	w0, #31, LBB0_7
; %bb.5:
Lloh13:
	adrp	x8, _dr_via_pages_locked@GOTPAGE
Lloh14:
	ldr	x8, [x8, _dr_via_pages_locked@GOTPAGEOFF]
Lloh15:
	ldr	x8, [x8]
	str	x8, [x19, #16]
Lloh16:
	adrp	x8, _EINVAL@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_6:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_7:
	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	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_FROM_DEVICE,8,3            ; @DMA_FROM_DEVICE
	.comm	_FOLL_WRITE,4,2                 ; @FOLL_WRITE
	.comm	_dr_via_pages_locked,8,3        ; @dr_via_pages_locked
	.comm	_EINVAL,4,2                     ; @EINVAL
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"DMA pages locked\n"

	.no_dead_strip	_via_lock_all_dma_pages
.subsections_via_symbols
