	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_get_user_pages             ## -- Begin function qib_get_user_pages
	.p2align	4, 0x90
_qib_get_user_pages:                    ## @qib_get_user_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	%rdx, %r14
	movq	%rsi, %r12
	movq	%rdi, %r15
	movq	_RLIMIT_MEMLOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_rlimit
	movq	%rax, %rbx
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shrq	%cl, %rbx
	movq	_current@GOTPCREL(%rip), %r13
	movq	(%r13), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_atomic64_add_return
	cmpq	%rbx, %rax
	jbe	LBB0_3
## %bb.1:
	movq	_CAP_IPC_LOCK@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_capable
	testl	%eax, %eax
	je	LBB0_2
LBB0_3:
	movq	(%r13), %rax
	movq	(%rax), %rdi
	addq	$4, %rdi
	callq	_down_read
	testq	%r12, %r12
	je	LBB0_10
## %bb.4:
	xorl	%ebx, %ebx
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rdi
	imulq	%rbx, %rdi
	addq	%r15, %rdi
	movq	%r12, %rsi
	movq	_FOLL_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	_FOLL_LONGTERM@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	subq	%rbx, %rsi
	movq	_FOLL_FORCE@GOTPCREL(%rip), %rax
	orl	(%rax), %edx
	leaq	(%r14,%rbx,8), %rcx
	xorl	%r8d, %r8d
	callq	_get_user_pages
	movl	%eax, %r13d
	testl	%eax, %eax
	js	LBB0_7
## %bb.5:                               ##   in Loop: Header=BB0_6 Depth=1
	movl	%r13d, %eax
	addq	%rax, %rbx
	cmpq	%r12, %rbx
	jb	LBB0_6
LBB0_10:
	movq	_current@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	(%rax), %rdi
	addq	$4, %rdi
	callq	_up_read
	xorl	%r13d, %r13d
	jmp	LBB0_9
LBB0_7:
	movq	_current@GOTPCREL(%rip), %r15
	movq	(%r15), %rax
	movq	(%rax), %rdi
	addq	$4, %rdi
	callq	_up_read
	movq	%r14, %rdi
	movq	%rbx, %rsi
	xorl	%edx, %edx
	callq	___qib_release_user_pages
	jmp	LBB0_8
LBB0_2:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movq	%r13, %r15
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_8:
	movq	(%r15), %rax
	movq	(%rax), %rsi
	movq	%r12, %rdi
	callq	_atomic64_sub
LBB0_9:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_RLIMIT_MEMLOCK,4,2             ## @RLIMIT_MEMLOCK
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.comm	_current,8,3                    ## @current
	.comm	_CAP_IPC_LOCK,4,2               ## @CAP_IPC_LOCK
	.comm	_ENOMEM,4,2                     ## @ENOMEM
	.comm	_PAGE_SIZE,8,3                  ## @PAGE_SIZE
	.comm	_FOLL_LONGTERM,4,2              ## @FOLL_LONGTERM
	.comm	_FOLL_WRITE,4,2                 ## @FOLL_WRITE
	.comm	_FOLL_FORCE,4,2                 ## @FOLL_FORCE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_qib_get_user_pages             ; -- Begin function qib_get_user_pages
	.p2align	2
_qib_get_user_pages:                    ; @qib_get_user_pages
	.cfi_startproc
; %bb.0:
	stp	x28, x27, [sp, #-96]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x20, x2
	mov	x19, x1
	mov	x21, x0
Lloh0:
	adrp	x8, _RLIMIT_MEMLOCK@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RLIMIT_MEMLOCK@GOTPAGEOFF]
Lloh2:
	ldr	w0, [x8]
	bl	_rlimit
Lloh3:
	adrp	x8, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x8, [x8, _PAGE_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	x8, [x8]
	lsr	x22, x0, x8
Lloh6:
	adrp	x24, _current@GOTPAGE
Lloh7:
	ldr	x24, [x24, _current@GOTPAGEOFF]
	ldr	x8, [x24]
	ldr	x1, [x8]
	mov	x0, x19
	bl	_atomic64_add_return
	cmp	x0, x22
	b.ls	LBB0_2
; %bb.1:
Lloh8:
	adrp	x8, _CAP_IPC_LOCK@GOTPAGE
Lloh9:
	ldr	x8, [x8, _CAP_IPC_LOCK@GOTPAGEOFF]
Lloh10:
	ldr	w0, [x8]
	bl	_capable
	cbz	w0, LBB0_8
LBB0_2:
	ldr	x8, [x24]
	ldr	x8, [x8]
	add	x0, x8, #4
	bl	_down_read
	cbz	x19, LBB0_6
; %bb.3:
	mov	x22, #0
Lloh11:
	adrp	x25, _PAGE_SIZE@GOTPAGE
Lloh12:
	ldr	x25, [x25, _PAGE_SIZE@GOTPAGEOFF]
Lloh13:
	adrp	x26, _FOLL_LONGTERM@GOTPAGE
Lloh14:
	ldr	x26, [x26, _FOLL_LONGTERM@GOTPAGEOFF]
Lloh15:
	adrp	x27, _FOLL_WRITE@GOTPAGE
Lloh16:
	ldr	x27, [x27, _FOLL_WRITE@GOTPAGEOFF]
Lloh17:
	adrp	x28, _FOLL_FORCE@GOTPAGE
Lloh18:
	ldr	x28, [x28, _FOLL_FORCE@GOTPAGEOFF]
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x25]
	madd	x0, x8, x22, x21
	sub	x1, x19, x22
	ldr	w8, [x26]
	ldr	w9, [x27]
	orr	w8, w9, w8
	ldr	w9, [x28]
	orr	w2, w8, w9
	add	x3, x20, x22, lsl #3
	mov	x4, #0
	bl	_get_user_pages
	mov	x23, x0
	tbnz	w0, #31, LBB0_7
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	add	x22, x22, w23, uxtw
	cmp	x22, x19
	b.lo	LBB0_4
LBB0_6:
	ldr	x8, [x24]
	ldr	x8, [x8]
	add	x0, x8, #4
	bl	_up_read
	mov	w23, #0
	b	LBB0_10
LBB0_7:
	ldr	x8, [x24]
	ldr	x8, [x8]
	add	x0, x8, #4
	bl	_up_read
	mov	x0, x20
	mov	x1, x22
	mov	w2, #0
	bl	___qib_release_user_pages
	b	LBB0_9
LBB0_8:
Lloh19:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh20:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh21:
	ldr	w8, [x8]
	neg	w23, w8
LBB0_9:
	ldr	x8, [x24]
	ldr	x1, [x8]
	mov	x0, x19
	bl	_atomic64_sub
LBB0_10:
	mov	x0, x23
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp], #96             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.loh AdrpLdrGot	Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh19, Lloh20, Lloh21
	.cfi_endproc
                                        ; -- End function
	.comm	_RLIMIT_MEMLOCK,4,2             ; @RLIMIT_MEMLOCK
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.comm	_current,8,3                    ; @current
	.comm	_CAP_IPC_LOCK,4,2               ; @CAP_IPC_LOCK
	.comm	_ENOMEM,4,2                     ; @ENOMEM
	.comm	_PAGE_SIZE,8,3                  ; @PAGE_SIZE
	.comm	_FOLL_LONGTERM,4,2              ; @FOLL_LONGTERM
	.comm	_FOLL_WRITE,4,2                 ; @FOLL_WRITE
	.comm	_FOLL_FORCE,4,2                 ; @FOLL_FORCE
.subsections_via_symbols
