	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function pin_sdma_pages
_pin_sdma_pages:                        ## @pin_sdma_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
	subq	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%ecx, %r15d
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	(%rdi), %r13
	movq	_GFP_KERNEL@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movl	%ecx, %edi
	movl	$8, %esi
	callq	_kcalloc
	testq	%rax, %rax
	je	LBB0_1
## %bb.3:
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rsi
	movl	(%r14), %edx
	shll	$3, %edx
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	movq	%rax, %rdi
	callq	_memcpy
	subl	(%r14), %r15d
	.p2align	4, 0x90
LBB0_4:                                 ## =>This Inner Loop Header: Depth=1
	movl	4(%r13), %r12d
	movl	8(%r13), %ebx
	movq	%r13, %rdi
	callq	_atomic_read
	movl	%ebx, %edi
	movl	%r12d, %esi
	movl	%eax, %edx
	movl	%r15d, %ecx
	callq	_hfi1_can_pin_pages
	testl	%eax, %eax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_4 Depth=1
	movq	%r13, %rdi
	movl	%r15d, %esi
	callq	_sdma_cache_evict
	cmpl	%r15d, %eax
	jge	LBB0_4
LBB0_6:
	movl	4(%r13), %edi
	movslq	(%r14), %rsi
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	leaq	(%rbx,%rsi,8), %r8
	imulq	(%rax), %rsi
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	addq	8(%rax), %rsi
	movl	%r15d, %edx
	xorl	%ecx, %ecx
	callq	_hfi1_acquire_user_pages
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:
	cmpl	%r15d, %r12d
	jne	LBB0_9
## %bb.10:
	movq	8(%r14), %rdi
	callq	_kfree
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, 16(%r14)
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, 8(%r14)
	movl	%r15d, %edi
	movq	%r13, %rsi
	callq	_atomic_add
	movl	%r15d, %r12d
	jmp	LBB0_11
LBB0_1:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	jmp	LBB0_2
LBB0_7:
	movq	%rbx, %rdi
	callq	_kfree
	jmp	LBB0_11
LBB0_9:
	movl	4(%r13), %edi
	movl	(%r14), %edx
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movl	%r12d, %ecx
	callq	_unpin_vector_pages
	movq	_EFAULT@GOTPCREL(%rip), %rax
LBB0_2:
	xorl	%r12d, %r12d
	subl	(%rax), %r12d
LBB0_11:
	movl	%r12d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_GFP_KERNEL,4,2                 ## @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_EFAULT,4,2                     ## @EFAULT
	.no_dead_strip	_pin_sdma_pages
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function pin_sdma_pages
_pin_sdma_pages:                        ; @pin_sdma_pages
	.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	x23, x3
	mov	x19, x2
	mov	x21, x1
	ldr	x20, [x0]
Lloh0:
	adrp	x8, _GFP_KERNEL@GOTPAGE
Lloh1:
	ldr	x8, [x8, _GFP_KERNEL@GOTPAGEOFF]
Lloh2:
	ldr	w2, [x8]
	mov	x0, x3
	mov	w1, #8
	bl	_kcalloc
	cbz	x0, LBB0_7
; %bb.1:
	mov	x22, x0
	ldr	x1, [x19, #8]
	ldr	w8, [x19]
	lsl	w2, w8, #3
	bl	_memcpy
	ldr	w8, [x19]
	sub	w23, w23, w8
LBB0_2:                                 ; =>This Inner Loop Header: Depth=1
	ldp	w25, w24, [x20, #4]
	mov	x0, x20
	bl	_atomic_read
	mov	x2, x0
	mov	x0, x24
	mov	x1, x25
	mov	x3, x23
	bl	_hfi1_can_pin_pages
	cbnz	w0, LBB0_4
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x0, x20
	mov	x1, x23
	bl	_sdma_cache_evict
	cmp	w0, w23
	b.ge	LBB0_2
LBB0_4:
	ldr	w0, [x20, #4]
	ldr	x8, [x21, #8]
	ldrsw	x9, [x19]
Lloh3:
	adrp	x10, _PAGE_SIZE@GOTPAGE
Lloh4:
	ldr	x10, [x10, _PAGE_SIZE@GOTPAGEOFF]
Lloh5:
	ldr	x10, [x10]
	madd	x1, x10, x9, x8
	add	x4, x22, x9, lsl #3
	mov	x2, x23
	mov	w3, #0
	bl	_hfi1_acquire_user_pages
	mov	x24, x0
	tbnz	w0, #31, LBB0_8
; %bb.5:
	cmp	w24, w23
	b.ne	LBB0_9
; %bb.6:
	ldr	x0, [x19, #8]
	bl	_kfree
	ldr	w8, [x21]
	str	w8, [x19, #16]
	str	x22, [x19, #8]
	mov	x0, x23
	mov	x1, x20
	bl	_atomic_add
	mov	x24, x23
	b	LBB0_11
LBB0_7:
Lloh6:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh7:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
	b	LBB0_10
LBB0_8:
	mov	x0, x22
	bl	_kfree
	b	LBB0_11
LBB0_9:
	ldr	w0, [x20, #4]
	ldr	w2, [x19]
	mov	x1, x22
	mov	x3, x24
	bl	_unpin_vector_pages
Lloh8:
	adrp	x8, _EFAULT@GOTPAGE
Lloh9:
	ldr	x8, [x8, _EFAULT@GOTPAGEOFF]
LBB0_10:
	ldr	w8, [x8]
	neg	w24, w8
LBB0_11:
	mov	x0, x24
	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
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh8, Lloh9
	.cfi_endproc
                                        ; -- End function
	.comm	_GFP_KERNEL,4,2                 ; @GFP_KERNEL
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_EFAULT,4,2                     ; @EFAULT
	.no_dead_strip	_pin_sdma_pages
.subsections_via_symbols
