	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function mmap_piobufs
_mmap_piobufs:                          ## @mmap_piobufs
	.cfi_startproc
## %bb.0:
	pushq	%rbp
	.cfi_def_cfa_offset 16
	.cfi_offset %rbp, -16
	movq	%rsp, %rbp
	.cfi_def_cfa_register %rbp
	pushq	%r14
	pushq	%rbx
	.cfi_offset %rbx, -32
	.cfi_offset %r14, -24
	movl	%ecx, %r14d
	movq	%rsi, %rcx
	movl	(%rdi), %eax
	movl	4(%rdi), %esi
	subl	%esi, %eax
	imull	(%rcx), %r8d
	cmpl	%r8d, %eax
	jbe	LBB0_1
## %bb.4:
	movl	12(%rcx), %edi
	leaq	L_.str(%rip), %rsi
	movl	%eax, %edx
	callq	_qib_devinfo
	movq	_EINVAL@GOTPCREL(%rip), %rcx
	xorl	%eax, %eax
	subl	(%rcx), %eax
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_1:
	movq	%rdi, %rbx
	movq	_VM_MAYREAD@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	notl	%edx
	andl	8(%rdi), %edx
	movq	_VM_DONTCOPY@GOTPCREL(%rip), %rdi
	movq	_VM_DONTEXPAND@GOTPCREL(%rip), %r8
	orl	(%rdi), %edx
	orl	(%r8), %edx
	addl	4(%rcx), %r14d
	movl	%edx, 8(%rbx)
	cmpl	$0, 8(%rcx)
	movl	12(%rbx), %r8d
	jne	LBB0_3
## %bb.2:
	movl	%r8d, %edi
	callq	_pgprot_writecombine
	movl	%eax, %r8d
	movl	%eax, 12(%rbx)
	movl	(%rbx), %eax
	movl	4(%rbx), %esi
	subl	%esi, %eax
LBB0_3:
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rcx
	movb	(%rcx), %cl
	shrq	%cl, %r14
	movq	%rbx, %rdi
	movq	%r14, %rdx
	movl	%eax, %ecx
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_io_remap_pfn_range             ## TAILCALL
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"FAIL mmap piobufs: reqlen %lx > PAGE\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_VM_MAYREAD,4,2                 ## @VM_MAYREAD
	.comm	_VM_DONTCOPY,4,2                ## @VM_DONTCOPY
	.comm	_VM_DONTEXPAND,4,2              ## @VM_DONTEXPAND
	.comm	_PAGE_SHIFT,8,3                 ## @PAGE_SHIFT
	.no_dead_strip	_mmap_piobufs
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function mmap_piobufs
_mmap_piobufs:                          ; @mmap_piobufs
	.cfi_startproc
; %bb.0:
	stp	x20, x19, [sp, #-32]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 32
	stp	x29, x30, [sp, #16]             ; 16-byte Folded Spill
	add	x29, sp, #16
	.cfi_def_cfa w29, 16
	.cfi_offset w30, -8
	.cfi_offset w29, -16
	.cfi_offset w19, -24
	.cfi_offset w20, -32
	mov	x9, x1
	ldp	w8, w1, [x0]
	ldr	w10, [x9]
	mul	w10, w10, w4
	sub	w8, w8, w1
	cmp	w8, w10
	b.ls	LBB0_2
; %bb.1:
	ldr	w0, [x9, #12]
Lloh0:
	adrp	x1, l_.str@PAGE
Lloh1:
	add	x1, x1, l_.str@PAGEOFF
	mov	x2, x8
	bl	_qib_devinfo
Lloh2:
	adrp	x8, _EINVAL@GOTPAGE
Lloh3:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh4:
	ldr	w8, [x8]
	neg	w0, w8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_2:
	mov	x19, x0
	ldp	w10, w9, [x9, #4]
	add	w20, w10, w3
Lloh5:
	adrp	x10, _VM_MAYREAD@GOTPAGE
Lloh6:
	ldr	x10, [x10, _VM_MAYREAD@GOTPAGEOFF]
Lloh7:
	ldr	w10, [x10]
	ldp	w11, w4, [x0, #8]
	bic	w10, w11, w10
Lloh8:
	adrp	x11, _VM_DONTCOPY@GOTPAGE
Lloh9:
	ldr	x11, [x11, _VM_DONTCOPY@GOTPAGEOFF]
Lloh10:
	ldr	w11, [x11]
	orr	w10, w11, w10
Lloh11:
	adrp	x11, _VM_DONTEXPAND@GOTPAGE
Lloh12:
	ldr	x11, [x11, _VM_DONTEXPAND@GOTPAGEOFF]
Lloh13:
	ldr	w11, [x11]
	orr	w10, w10, w11
	str	w10, [x0, #8]
	cbnz	w9, LBB0_4
; %bb.3:
	mov	x0, x4
	bl	_pgprot_writecombine
	mov	x4, x0
	str	w0, [x19, #12]
	ldp	w8, w1, [x19]
	sub	w8, w8, w1
LBB0_4:
Lloh14:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh15:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh16:
	ldr	x9, [x9]
	lsr	x2, x20, x9
	mov	x0, x19
	mov	x3, x8
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_io_remap_pfn_range
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"FAIL mmap piobufs: reqlen %lx > PAGE\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_VM_MAYREAD,4,2                 ; @VM_MAYREAD
	.comm	_VM_DONTCOPY,4,2                ; @VM_DONTCOPY
	.comm	_VM_DONTEXPAND,4,2              ; @VM_DONTEXPAND
	.comm	_PAGE_SHIFT,8,3                 ; @PAGE_SHIFT
	.no_dead_strip	_mmap_piobufs
.subsections_via_symbols
