	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_user_sdma_pin_pages
_qib_user_sdma_pin_pages:               ## @qib_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	$120, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdx, -152(%rbp)                ## 8-byte Spill
	movq	%rsi, -144(%rbp)                ## 8-byte Spill
	movq	%rdi, -136(%rbp)                ## 8-byte Spill
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -48(%rbp)
	testl	%r9d, %r9d
	je	LBB0_1
## %bb.2:
	movl	%r9d, %r14d
	movl	%r8d, %r15d
	movq	%rcx, %rbx
	movq	_FOLL_LONGTERM@GOTPCREL(%rip), %rax
	leaq	-112(%rbp), %rcx
	jmp	LBB0_3
	.p2align	4, 0x90
LBB0_9:                                 ##   in Loop: Header=BB0_3 Depth=1
	movl	-120(%rbp), %r14d               ## 4-byte Reload
	subl	-116(%rbp), %r14d               ## 4-byte Folded Reload
	movq	_FOLL_LONGTERM@GOTPCREL(%rip), %rax
	leaq	-112(%rbp), %rcx
	je	LBB0_14
LBB0_3:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_6 Depth 2
	cmpl	$8, %r14d
	movl	$8, %r12d
	cmovll	%r14d, %r12d
	movl	(%rax), %edx
	movq	%rbx, %rdi
	movl	%r12d, %esi
	callq	_get_user_pages_fast
	cmpl	%r12d, %eax
	jne	LBB0_10
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	%r14d, -120(%rbp)               ## 4-byte Spill
	testl	%r14d, %r14d
	movl	%r12d, -116(%rbp)               ## 4-byte Spill
	jle	LBB0_9
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	cmpl	$2, %r12d
	movl	$1, %eax
	cmovgel	%r12d, %eax
	movq	%rax, -128(%rbp)                ## 8-byte Spill
	xorl	%r14d, %r14d
	.p2align	4, 0x90
LBB0_6:                                 ##   Parent Loop BB0_3 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	_PAGE_MASK@GOTPCREL(%rip), %rax
	movq	(%rax), %r9
	notq	%r9
	andq	%rbx, %r9
	movslq	%r15d, %rax
	leaq	(%r9,%rax), %rcx
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rdx
	movq	(%rdx), %rdx
	movq	%rdx, %r13
	subq	%r9, %r13
	cmpq	%rdx, %rcx
	cmovbeq	%rax, %r13
	movq	-112(%rbp,%r14,8), %rcx
	movq	-136(%rbp), %rdi                ## 8-byte Reload
	movq	-144(%rbp), %rsi                ## 8-byte Reload
	movq	-152(%rbp), %rdx                ## 8-byte Reload
	movl	$1, %r8d
	pushq	$0
	pushq	%r13
	callq	_qib_user_sdma_page_to_frags
	addq	$16, %rsp
	movl	%eax, %r12d
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=2
	movslq	%r13d, %rax
	addq	%rax, %rbx
	subl	%r13d, %r15d
	incq	%r14
	cmpq	%r14, -128(%rbp)                ## 8-byte Folded Reload
	jne	LBB0_6
	jmp	LBB0_9
LBB0_7:
	incl	%r14d
	movl	-116(%rbp), %eax                ## 4-byte Reload
	cmpl	%eax, %r14d
	jge	LBB0_14
LBB0_12:
	movl	%r14d, %ebx
	movl	%eax, %r14d
	.p2align	4, 0x90
LBB0_13:                                ## =>This Inner Loop Header: Depth=1
	movq	-112(%rbp,%rbx,8), %rdi
	incq	%rbx
	callq	_put_user_page
	cmpq	%rbx, %r14
	jne	LBB0_13
	jmp	LBB0_14
LBB0_1:
	xorl	%r12d, %r12d
LBB0_14:
	movq	___stack_chk_guard@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	cmpq	-48(%rbp), %rax
	jne	LBB0_16
## %bb.15:
	movl	%r12d, %eax
	addq	$120, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_10:
	movq	_ENOMEM@GOTPCREL(%rip), %rcx
	xorl	%r14d, %r14d
	xorl	%r12d, %r12d
	subl	(%rcx), %r12d
	cmpl	%eax, %r14d
	jl	LBB0_12
	jmp	LBB0_14
LBB0_16:
	callq	___stack_chk_fail
	.cfi_endproc
                                        ## -- End function
	.comm	_FOLL_LONGTERM,4,2              ## @FOLL_LONGTERM
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_MASK,8,3                  ## @PAGE_MASK
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.no_dead_strip	_qib_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 qib_user_sdma_pin_pages
_qib_user_sdma_pin_pages:               ; @qib_user_sdma_pin_pages
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #176
	.cfi_def_cfa_offset 176
	stp	x28, x27, [sp, #80]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #96]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #112]            ; 16-byte Folded Spill
	stp	x22, x21, [sp, #128]            ; 16-byte Folded Spill
	stp	x20, x19, [sp, #144]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #160]            ; 16-byte Folded Spill
	add	x29, sp, #160
	.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
Lloh0:
	adrp	x8, ___stack_chk_guard@GOTPAGE
Lloh1:
	ldr	x8, [x8, ___stack_chk_guard@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	str	x8, [sp, #72]
	cbz	w5, LBB0_12
; %bb.1:
	mov	x19, x5
	mov	x20, x4
	mov	x21, x3
	mov	x22, x2
	mov	x23, x1
	mov	x24, x0
Lloh3:
	adrp	x8, _FOLL_LONGTERM@GOTPAGE
Lloh4:
	ldr	x8, [x8, _FOLL_LONGTERM@GOTPAGEOFF]
	mov	w9, #8
LBB0_2:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_5 Depth 2
	cmp	w19, #8
	csel	w25, w19, w9, lt
	ldr	w2, [x8]
	add	x3, sp, #8
	mov	x0, x21
	mov	x1, x25
	bl	_get_user_pages_fast
	cmp	w0, w25
	b.ne	LBB0_15
; %bb.3:                                ;   in Loop: Header=BB0_2 Depth=1
	str	w19, [sp, #4]                   ; 4-byte Folded Spill
	cmp	w19, #1
	b.lt	LBB0_7
; %bb.4:                                ;   in Loop: Header=BB0_2 Depth=1
	mov	x28, #0
	cmp	w25, #1
	csinc	w19, w25, wzr, gt
LBB0_5:                                 ;   Parent Loop BB0_2 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
Lloh5:
	adrp	x8, _PAGE_MASK@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PAGE_MASK@GOTPAGEOFF]
Lloh7:
	ldr	x8, [x8]
	bic	x5, x21, x8
	sxtw	x8, w20
Lloh8:
	adrp	x9, _PAGE_SIZE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PAGE_SIZE@GOTPAGEOFF]
Lloh10:
	ldr	x9, [x9]
	sub	x10, x9, x5
	add	x11, x5, x8
	cmp	x11, x9
	csel	x27, x10, x8, hi
	add	x8, sp, #8
	ldr	x3, [x8, x28, lsl #3]
	mov	x0, x24
	mov	x1, x23
	mov	x2, x22
	mov	w4, #1
	mov	x6, x27
	mov	x7, #0
	bl	_qib_user_sdma_page_to_frags
	mov	x26, x0
	tbnz	w0, #31, LBB0_9
; %bb.6:                                ;   in Loop: Header=BB0_5 Depth=2
	add	x21, x21, w27, sxtw
	sub	w20, w20, w27
	add	x28, x28, #1
	cmp	x19, x28
	b.ne	LBB0_5
	b	LBB0_8
LBB0_7:                                 ;   in Loop: Header=BB0_2 Depth=1
	mov	x26, x25
LBB0_8:                                 ;   in Loop: Header=BB0_2 Depth=1
	ldr	w19, [sp, #4]                   ; 4-byte Folded Reload
	subs	w19, w19, w25
Lloh11:
	adrp	x8, _FOLL_LONGTERM@GOTPAGE
Lloh12:
	ldr	x8, [x8, _FOLL_LONGTERM@GOTPAGEOFF]
	mov	w9, #8
	b.ne	LBB0_2
	b	LBB0_13
LBB0_9:
	add	w8, w28, #1
	cmp	w8, w25
	b.ge	LBB0_13
LBB0_10:
	mov	w9, w25
	add	x10, sp, #8
	add	x19, x10, w8, uxtw #3
	sub	x20, x9, w8, uxtw
LBB0_11:                                ; =>This Inner Loop Header: Depth=1
	ldr	x0, [x19], #8
	bl	_put_user_page
	subs	x20, x20, #1
	b.ne	LBB0_11
	b	LBB0_13
LBB0_12:
	mov	w26, #0
LBB0_13:
	ldr	x8, [sp, #72]
Lloh13:
	adrp	x9, ___stack_chk_guard@GOTPAGE
Lloh14:
	ldr	x9, [x9, ___stack_chk_guard@GOTPAGEOFF]
Lloh15:
	ldr	x9, [x9]
	cmp	x9, x8
	b.ne	LBB0_16
; %bb.14:
	mov	x0, x26
	ldp	x29, x30, [sp, #160]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #144]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #128]            ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #112]            ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #96]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #80]             ; 16-byte Folded Reload
	add	sp, sp, #176
	ret
LBB0_15:
	mov	w8, #0
Lloh16:
	adrp	x9, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x9, [x9, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w9, [x9]
	neg	w26, w9
	mov	x25, x0
	cmp	w8, w25
	b.lt	LBB0_10
	b	LBB0_13
LBB0_16:
	bl	___stack_chk_fail
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_FOLL_LONGTERM,4,2              ; @FOLL_LONGTERM
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_MASK,8,3                  ; @PAGE_MASK
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.no_dead_strip	_qib_user_sdma_pin_pages
.subsections_via_symbols
