	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function ipath_user_sdma_pin_pages
_ipath_user_sdma_pin_pages:             ## @ipath_user_sdma_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
	subq	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r14d
	movl	%ecx, %r13d
	movq	%rdx, %r15
	movq	%rsi, -72(%rbp)                 ## 8-byte Spill
	movq	%rdi, -96(%rbp)                 ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	movl	(%rdi), %esi
	leaq	-64(%rbp), %rax
	movl	%r8d, %ecx
	xorl	%r8d, %r8d
	movl	$1, %r9d
	pushq	$0
	pushq	%rax
	callq	_get_user_pages
	addq	$16, %rsp
	cmpl	%r14d, %eax
	jne	LBB0_1
## %bb.5:
	testl	%r14d, %r14d
	jle	LBB0_10
## %bb.6:
	movl	%r14d, -76(%rbp)                ## 4-byte Spill
	movl	%r14d, %eax
	movq	%rax, -104(%rbp)                ## 8-byte Spill
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_7:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	%r13d, %esi
	callq	_ipath_user_sdma_page_length
	movl	%eax, %r14d
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movq	%rbx, -120(%rbp)                ## 8-byte Spill
	movq	-64(%rbp,%rbx,8), %rsi
	movq	_DMA_TO_DEVICE@GOTPCREL(%rip), %rax
	movl	(%rax), %r8d
	xorl	%edx, %edx
	movl	%r14d, %ecx
	callq	_dma_map_page
	movl	%eax, %ebx
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %r12
	movq	-96(%rbp), %rax                 ## 8-byte Reload
	movq	(%rax), %rdi
	movl	%ebx, %esi
	callq	_dma_mapping_error
	testq	%rax, %rax
	jne	LBB0_4
## %bb.8:                               ##   in Loop: Header=BB0_7 Depth=1
	notq	%r12
	andq	%r15, %r12
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %eax
	movl	%eax, -80(%rbp)                 ## 4-byte Spill
	movl	%r13d, -84(%rbp)                ## 4-byte Spill
	movq	-120(%rbp), %r13                ## 8-byte Reload
	movq	-64(%rbp,%r13,8), %rdi
	movq	%rdi, -112(%rbp)                ## 8-byte Spill
	callq	_kmap
                                        ## kill: def $eax killed $eax def $rax
	subq	$8, %rsp
	movq	-72(%rbp), %rdi                 ## 8-byte Reload
	movl	-80(%rbp), %esi                 ## 4-byte Reload
	movq	%r12, %rdx
	movl	%r14d, %ecx
	movl	$1, %r8d
	movl	$1, %r9d
	pushq	%rbx
	movq	%r13, %rbx
	pushq	%rax
	pushq	-112(%rbp)                      ## 8-byte Folded Reload
	movl	-84(%rbp), %r13d                ## 4-byte Reload
	callq	_ipath_user_sdma_init_frag
	addq	$32, %rsp
	movq	-72(%rbp), %rax                 ## 8-byte Reload
	incl	(%rax)
	movslq	%r14d, %rax
	addq	%rax, %r15
	subl	%r14d, %r13d
	incq	%rbx
	cmpq	%rbx, -104(%rbp)                ## 8-byte Folded Reload
	jne	LBB0_7
## %bb.9:
	movl	-76(%rbp), %r14d                ## 4-byte Reload
	jmp	LBB0_10
LBB0_1:
	testl	%eax, %eax
	jle	LBB0_4
## %bb.2:
	movl	%eax, %r14d
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	-64(%rbp,%rbx,8), %rdi
	callq	_put_page
	incq	%rbx
	cmpq	%rbx, %r14
	jne	LBB0_3
LBB0_4:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	xorl	%r14d, %r14d
	subl	(%rax), %r14d
LBB0_10:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_12
## %bb.11:
	movl	%r14d, %eax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_current,8,3                    ## @current
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ## @DMA_TO_DEVICE
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.no_dead_strip	_ipath_user_sdma_pin_pages
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function ipath_user_sdma_pin_pages
_ipath_user_sdma_pin_pages:             ; @ipath_user_sdma_pin_pages
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x23, x4
	mov	x20, x3
	mov	x21, x2
	mov	x22, x1
	str	x0, [sp, #16]                   ; 8-byte Folded Spill
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #40]
Lloh3:
	adrp	x8, _current@GOTPAGE
Lloh4:
	ldr	x8, [x8, _current@GOTPAGEOFF]
Lloh5:
	ldr	x0, [x8]
	ldr	w1, [x0]
	add	x6, sp, #24
	mov	x3, x4
	mov	w4, #0
	mov	w5, #1
	mov	x7, #0
	bl	_get_user_pages
	cmp	w0, w23
	b.ne	LBB0_6
; %bb.1:
	cmp	w23, #1
	b.lt	LBB0_10
; %bb.2:
	add	x19, sp, #24
	str	w23, [sp, #12]                  ; 4-byte Folded Spill
	mov	w23, w23
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	x1, x20
	bl	_ipath_user_sdma_page_length
	mov	x24, x0
	ldr	x27, [sp, #16]                  ; 8-byte Folded Reload
	ldr	x0, [x27]
	ldr	x1, [x19]
Lloh6:
	adrp	x8, _DMA_TO_DEVICE@GOTPAGE
Lloh7:
	ldr	x8, [x8, _DMA_TO_DEVICE@GOTPAGEOFF]
Lloh8:
	ldr	w4, [x8]
	mov	w2, #0
	mov	x3, x24
	bl	_dma_map_page
	mov	x25, x0
Lloh9:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh11:
	ldr	x26, [x8]
	ldr	x0, [x27]
	mov	x1, x25
	bl	_dma_mapping_error
	cbnz	x0, LBB0_9
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	bic	x26, x21, x26
	ldr	w27, [x22]
	ldr	x28, [x19], #8
	mov	x0, x28
	bl	_kmap
	mov	x7, x0
	str	w25, [sp]
	mov	x0, x22
	mov	x1, x27
	mov	x2, x26
	mov	x3, x24
	mov	w4, #1
	mov	w5, #1
	mov	x6, x28
	bl	_ipath_user_sdma_init_frag
	ldr	w8, [x22]
	add	w8, w8, #1
	str	w8, [x22]
	add	x21, x21, w24, sxtw
	sub	w20, w20, w24
	subs	x23, x23, #1
	b.ne	LBB0_3
; %bb.5:
	ldr	w23, [sp, #12]                  ; 4-byte Folded Reload
	b	LBB0_10
LBB0_6:
	cmp	w0, #1
	b.lt	LBB0_9
; %bb.7:
	mov	w19, w0
	add	x20, sp, #24
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x20], #8
	bl	_put_page
	subs	x19, x19, #1
	b.ne	LBB0_8
LBB0_9:
Lloh12:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh13:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh14:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_10:
	ldr	x8, [sp, #40]
Lloh15:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh16:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh17:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_12
; %bb.11:
	mov	x0, x23
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_12:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGotLdr	Lloh15, Lloh16, Lloh17
	.cfi_endproc
                                        ; -- End function
	.comm	_current,8,3                    ; @current
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_DMA_TO_DEVICE,4,2              ; @DMA_TO_DEVICE
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.no_dead_strip	_ipath_user_sdma_pin_pages
.subsections_via_symbols
