	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function afu_dma_pin_pages
_afu_dma_pin_pages:                     ## @afu_dma_pin_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	%r13
	pushq	%r12
	pushq	%rbx
	pushq	%rax
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rsi, %r14
	movl	(%rsi), %r15d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	sarl	%cl, %r15d
	movq	(%rdi), %r12
	movq	_current@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	movl	$1, %edx
	callq	_account_locked_vm
	movl	%eax, %ebx
	testl	%eax, %eax
	jne	LBB0_9
## %bb.1:
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%r15d, %edi
	movl	$8, %esi
	callq	_kcalloc
	movl	%eax, 4(%r14)
	testl	%eax, %eax
	je	LBB0_2
## %bb.3:
	movl	8(%r14), %edi
	movq	_FOLL_WRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movl	%r15d, %esi
	movl	%eax, %ecx
	callq	_get_user_pages_fast
	movl	%eax, %ebx
	testl	%eax, %eax
	js	LBB0_4
## %bb.5:
	cmpl	%r15d, %ebx
	jne	LBB0_6
## %bb.10:
	leaq	L_.str(%rip), %rsi
	movq	%r12, %rdi
	movl	%r15d, %edx
	callq	_dev_dbg
	xorl	%ebx, %ebx
	jmp	LBB0_9
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_8
LBB0_4:
	movl	4(%r14), %edi
	movl	%ebx, %esi
	callq	_put_all_pages
	jmp	LBB0_7
LBB0_6:
	movq	_EFAULT@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_7:
	movl	4(%r14), %edi
	callq	_kfree
LBB0_8:
	movq	(%r13), %rax
	movl	(%rax), %edi
	movl	%r15d, %esi
	xorl	%edx, %edx
	callq	_account_locked_vm
LBB0_9:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_current,8,3                    ## @current
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_FOLL_WRITE,4,2                 ## @FOLL_WRITE
	.comm	_EFAULT,4,2                     ## @EFAULT
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"%d pages pinned\n"

	.no_dead_strip	_afu_dma_pin_pages
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function afu_dma_pin_pages
_afu_dma_pin_pages:                     ; @afu_dma_pin_pages
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x20, x1
	ldr	w8, [x1]
Lloh0:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh1:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	asr	w19, w8, w9
	ldr	x21, [x0]
Lloh3:
	adrp	x23, _current@GOTPAGE
Lloh4:
	ldr	x23, [x23, _current@GOTPAGEOFF]
	ldr	x8, [x23]
	ldr	w0, [x8]
	mov	x1, x19
	mov	w2, #1
	bl	_account_locked_vm
	mov	x22, x0
	cbnz	w0, LBB0_10
; %bb.1:
Lloh5:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh6:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x19
	mov	w1, #8
	bl	_kcalloc
	str	w0, [x20, #4]
	cbz	w0, LBB0_5
; %bb.2:
	mov	x3, x0
	ldr	w0, [x20, #8]
Lloh8:
	adrp	x8, _FOLL_WRITE@GOTPAGE
Lloh9:
	ldr	x8, [x8, _FOLL_WRITE@GOTPAGEOFF]
Lloh10:
	ldr	w2, [x8]
	mov	x1, x19
	bl	_get_user_pages_fast
	mov	x22, x0
	tbnz	w0, #31, LBB0_6
; %bb.3:
	cmp	w22, w19
	b.ne	LBB0_7
; %bb.4:
Lloh11:
	adrp	x1, l_.str@PAGE
Lloh12:
	add	x1, x1, l_.str@PAGEOFF
	mov	x0, x21
	mov	x2, x19
	bl	_dev_dbg
	mov	w22, #0
	b	LBB0_10
LBB0_5:
Lloh13:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh14:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	neg	w22, w8
	b	LBB0_9
LBB0_6:
	ldr	w0, [x20, #4]
	mov	x1, x22
	bl	_put_all_pages
	b	LBB0_8
LBB0_7:
Lloh16:
	adrp	x8, _EFAULT@GOTPAGE
Lloh17:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
Lloh18:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_8:
	ldr	w0, [x20, #4]
	bl	_kfree
LBB0_9:
	ldr	x8, [x23]
	ldr	w0, [x8]
	mov	x1, x19
	mov	w2, #0
	bl	_account_locked_vm
LBB0_10:
	mov	x0, x22
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpAdd	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_current,8,3                    ; @current
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_FOLL_WRITE,4,2                 ; @FOLL_WRITE
	.comm	_EFAULT,4,2                     ; @EFAULT
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"%d pages pinned\n"

	.no_dead_strip	_afu_dma_pin_pages
.subsections_via_symbols
