	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmap_rcvegrbufs
_mmap_rcvegrbufs:                       ## @mmap_rcvegrbufs
	.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, %r12
	movq	24(%rsi), %rsi
	movq	(%r12), %rbx
	movq	8(%r12), %rax
	movq	%rax, %rcx
	imulq	%rbx, %rcx
	movq	(%rdi), %rdx
	movq	8(%rdi), %r13
	subq	%r13, %rdx
	cmpq	%rcx, %rdx
	jbe	LBB0_2
## %bb.1:
	movl	(%rsi), %edi
	leaq	L_.str(%rip), %rsi
	xorl	%ebx, %ebx
                                        ## kill: def $edx killed $edx killed $rdx
	xorl	%eax, %eax
	callq	_qib_devinfo
	movq	_EINVAL@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_2:
	movq	%rdi, %r14
	movl	16(%rdi), %edx
	movq	_VM_WRITE@GOTPCREL(%rip), %rcx
	testl	%edx, (%rcx)
	je	LBB0_4
## %bb.3:
	movl	(%rsi), %edi
	leaq	L_.str.1(%rip), %rsi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_qib_devinfo
	movq	_EPERM@GOTPCREL(%rip), %rax
	subl	(%rax), %ebx
	jmp	LBB0_10
LBB0_4:
	movq	_VM_MAYWRITE@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	notl	%ecx
	andl	%ecx, %edx
	movl	%edx, 16(%r14)
	testq	%rax, %rax
	je	LBB0_9
## %bb.5:
	xorl	%r15d, %r15d
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movq	16(%r12), %rax
	movl	(%rax,%r15,4), %edi
	callq	_virt_to_phys
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movzbl	(%rcx), %ecx
	shrq	%cl, %rax
	movl	20(%r14), %r8d
	movq	%r14, %rdi
	movq	%r13, %rsi
	movq	%rax, %rdx
	movq	%rbx, %rcx
	callq	_remap_pfn_range
	testl	%eax, %eax
	js	LBB0_7
## %bb.8:                               ##   in Loop: Header=BB0_6 Depth=1
	movq	%rbx, %rcx
	incq	%r15
	addq	%rbx, %r13
	cmpq	8(%r12), %r15
	jb	LBB0_6
LBB0_9:
	xorl	%ebx, %ebx
	jmp	LBB0_10
LBB0_7:
	movl	%eax, %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FAIL on egr bufs: reqlen %lx > actual %lx\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VM_WRITE,4,2                   ## @VM_WRITE
L_.str.1:                               ## @.str.1
	.asciz	"Can't map eager buffers as writable (flags=%lx)\n"

	.comm	_EPERM,4,2                      ## @EPERM
	.comm	_VM_MAYWRITE,4,2                ## @VM_MAYWRITE
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.no_dead_strip	_mmap_rcvegrbufs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmap_rcvegrbufs
_mmap_rcvegrbufs:                       ; @mmap_rcvegrbufs
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.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
	ldr	x8, [x1, #24]
	ldp	x21, x9, [x1]
	mul	x10, x9, x21
	ldp	x11, x22, [x0]
	sub	x2, x11, x22
	cmp	x2, x10
	b.ls	LBB0_2
; %bb.1:
	ldr	w0, [x8]
	str	x10, [sp]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
                                        ; kill: def $w2 killed $w2 killed $x2
	bl	_qib_devinfo
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
	b	LBB0_4
LBB0_2:
	mov	x20, x0
	ldr	w2, [x0, #16]
Lloh4:
	adrp	x10, _VM_WRITE@GOTPAGE
Lloh5:
	ldr	x10, [x10, _VM_WRITE@GOTPAGEOFF]
Lloh6:
	ldr	w10, [x10]
	tst	w10, w2
	b.eq	LBB0_6
; %bb.3:
	ldr	w0, [x8]
Lloh7:
	adrp	x1, l_.str.1@PAGE
Lloh8:
	add	x1, x1, l_.str.1@PAGEOFF
	bl	_qib_devinfo
Lloh9:
	adrp	x8, _EPERM@GOTPAGE
Lloh10:
	ldr	x8, [x8, _EPERM@GOTPAGEOFF]
LBB0_4:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_5:
	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
	add	sp, sp, #80
	ret
LBB0_6:
Lloh11:
	adrp	x8, _VM_MAYWRITE@GOTPAGE
Lloh12:
	ldr	x8, [x8, _VM_MAYWRITE@GOTPAGEOFF]
Lloh13:
	ldr	w8, [x8]
	bic	w8, w2, w8
	str	w8, [x20, #16]
	cbz	x9, LBB0_10
; %bb.7:
	mov	x19, x1
	mov	x23, #0
Lloh14:
	adrp	x24, _PAGE_SHIFT@GOTPAGE
Lloh15:
	ldr	x24, [x24, _PAGE_SHIFT@GOTPAGEOFF]
LBB0_8:                                 ; =>This Inner Loop Header: Depth=1
	ldr	x8, [x19, #16]
	ldr	w0, [x8, x23, lsl #2]
	bl	_virt_to_phys
	ldr	x8, [x24]
	lsr	x2, x0, x8
	ldr	w4, [x20, #20]
	mov	x0, x20
	mov	x1, x22
	mov	x3, x21
	bl	_remap_pfn_range
	tbnz	w0, #31, LBB0_5
; %bb.9:                                ;   in Loop: Header=BB0_8 Depth=1
	add	x23, x23, #1
	add	x22, x22, x21
	ldr	x8, [x19, #8]
	cmp	x23, x8
	b.lo	LBB0_8
LBB0_10:
	mov	w0, #0
	b	LBB0_5
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh4, Lloh5, Lloh6
	.loh AdrpLdrGot	Lloh9, Lloh10
	.loh AdrpAdd	Lloh7, Lloh8
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FAIL on egr bufs: reqlen %lx > actual %lx\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VM_WRITE,4,2                   ; @VM_WRITE
l_.str.1:                               ; @.str.1
	.asciz	"Can't map eager buffers as writable (flags=%lx)\n"

	.comm	_EPERM,4,2                      ; @EPERM
	.comm	_VM_MAYWRITE,4,2                ; @VM_MAYWRITE
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.no_dead_strip	_mmap_rcvegrbufs
.subsections_via_symbols
