	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qib_mmapf
_qib_mmapf:                             ## @qib_mmapf
	.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	%rdi, %rbx
	callq	_ctxt_fp
	testq	%rax, %rax
	je	LBB0_5
## %bb.1:
	movq	%rax, %r13
	movq	_VM_SHARED@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_5
## %bb.2:
	movl	4(%r12), %r14d
	movq	_PAGE_SHIFT@GOTPCREL(%rip), %rax
	movb	(%rax), %cl
	shll	%cl, %r14d
	testl	%r14d, %r14d
	je	LBB0_5
## %bb.3:
	movq	64(%r13), %r15
	movq	%rbx, %rdi
	callq	_subctxt_fp
	movq	%r12, %rdi
	movl	%r14d, %esi
	movq	%r13, %rdx
	movl	%eax, %ecx
	callq	_mmap_kvaddr
	testl	%eax, %eax
	je	LBB0_8
## %bb.4:
	movl	%eax, %ecx
	sarl	$31, %ecx
	andl	%eax, %ecx
	movl	%ecx, %eax
	jmp	LBB0_7
LBB0_5:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
LBB0_6:
	movl	%ebx, %eax
LBB0_7:
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%r15, %rax
	movl	(%r13), %r15d
	imull	4(%rax), %r15d
	movq	%rax, -48(%rbp)                 ## 8-byte Spill
	addl	(%rax), %r15d
	cmpl	$0, 4(%r13)
	je	LBB0_11
## %bb.9:
	movq	%rbx, %rdi
	callq	_subctxt_fp
	testl	%eax, %eax
	je	LBB0_18
## %bb.10:
	movq	%rbx, %rdi
	callq	_subctxt_fp
	movl	%eax, %ecx
	decl	%ecx
	movl	8(%r13), %eax
	xorl	%edx, %edx
	divl	4(%r13)
	movl	%eax, %r8d
	imull	%eax, %ecx
	jmp	LBB0_19
LBB0_11:
	movl	8(%r13), %r8d
	movl	12(%r13), %ecx
	cmpl	%r15d, %r14d
	je	LBB0_20
LBB0_12:
	cmpl	%ecx, %r14d
	jne	LBB0_14
## %bb.13:
	movq	%r12, %rdi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	movq	%r13, %rdx
	movl	%r14d, %ecx
	callq	_mmap_piobufs
	jmp	LBB0_21
LBB0_14:
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	cmpl	12(%r15), %r14d
	jne	LBB0_24
## %bb.15:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	24(%r15), %rcx
	leaq	L_.str(%rip), %r9
LBB0_16:
	movq	%r12, %rdi
	movq	%r13, %rsi
	xorl	%r8d, %r8d
LBB0_17:
	callq	_qib_mmap_mem
	jmp	LBB0_21
LBB0_18:
	movl	8(%r13), %ecx
	movl	%ecx, %eax
	xorl	%edx, %edx
	divl	4(%r13)
	movl	%edx, %r8d
	addl	%eax, %r8d
	subl	%r8d, %ecx
LBB0_19:
	movq	-48(%rbp), %rax                 ## 8-byte Reload
	imull	8(%rax), %ecx
	addl	12(%r13), %ecx
	cmpl	%r15d, %r14d
	jne	LBB0_12
LBB0_20:
	movq	%r12, %rdi
	movq	-48(%rbp), %r15                 ## 8-byte Reload
	movq	%r15, %rsi
	movl	%r14d, %edx
	callq	_mmap_ureg
LBB0_21:
	movl	%eax, %ebx
LBB0_22:
	movq	$0, 24(%r12)
	testl	%ebx, %ebx
	jns	LBB0_6
## %bb.23:
	movl	16(%r15), %edi
	movl	%ebx, %edx
	negl	%edx
	movl	%r14d, %ecx
	movq	16(%r12), %r8
	subq	8(%r12), %r8
	leaq	L_.str.3(%rip), %rsi
	callq	_qib_devinfo
	jmp	LBB0_6
LBB0_24:
	cmpl	16(%r13), %r14d
	jne	LBB0_26
## %bb.25:
	movq	%r12, %rdi
	movq	%r13, %rsi
	callq	_mmap_rcvegrbufs
	jmp	LBB0_21
LBB0_26:
	cmpl	56(%r13), %r14d
	jne	LBB0_28
## %bb.27:
	movl	48(%r13), %edx
	movq	24(%r13), %rcx
	leaq	L_.str.1(%rip), %r9
	movq	%r12, %rdi
	movq	%r13, %rsi
	movl	$1, %r8d
	jmp	LBB0_17
LBB0_28:
	cmpl	40(%r13), %r14d
	jne	LBB0_30
## %bb.29:
	movq	_PAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %edx
	movq	32(%r13), %rcx
	leaq	L_.str.2(%rip), %r9
	jmp	LBB0_16
LBB0_30:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	jmp	LBB0_22
	.cfi_endproc
                                        ## -- End function
	.comm	_VM_SHARED,4,2                  ## @VM_SHARED
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_PAGE_SHIFT,4,2                 ## @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ## @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"pioavail registers"

L_.str.1:                               ## @.str.1
	.asciz	"rcvhdrq"

L_.str.2:                               ## @.str.2
	.asciz	"rcvhdrq tail"

L_.str.3:                               ## @.str.3
	.asciz	"mmap Failure %d: off %llx len %lx\n"

	.no_dead_strip	_qib_mmapf
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qib_mmapf
_qib_mmapf:                             ; @qib_mmapf
	.cfi_startproc
; %bb.0:
	stp	x24, x23, [sp, #-64]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	mov	x19, x1
	mov	x23, x0
	bl	_ctxt_fp
	cbz	x0, LBB0_5
; %bb.1:
	ldr	w8, [x19]
Lloh0:
	adrp	x9, _VM_SHARED@GOTPAGE
Lloh1:
	ldr	x9, [x9, _VM_SHARED@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_5
; %bb.2:
	ldr	w8, [x19, #4]
Lloh3:
	adrp	x9, _PAGE_SHIFT@GOTPAGE
Lloh4:
	ldr	x9, [x9, _PAGE_SHIFT@GOTPAGEOFF]
Lloh5:
	ldr	w9, [x9]
	lsl	w20, w8, w9
	cbz	w20, LBB0_5
; %bb.3:
	mov	x22, x0
	ldr	x21, [x0, #64]
	mov	x0, x23
	bl	_subctxt_fp
	mov	x3, x0
	mov	x0, x19
	mov	x1, x20
	mov	x2, x22
	bl	_mmap_kvaddr
	cbz	w0, LBB0_8
; %bb.4:
	cmp	w0, #0
	csel	w0, w0, wzr, lt
	b	LBB0_7
LBB0_5:
Lloh6:
	adrp	x8, _EINVAL@GOTPAGE
Lloh7:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh8:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_6:
	mov	x0, x22
LBB0_7:
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp], #64             ; 16-byte Folded Reload
	ret
LBB0_8:
	ldp	w8, w9, [x21]
	ldp	w10, w11, [x22]
	madd	w24, w10, w9, w8
	cbz	w11, LBB0_11
; %bb.9:
	mov	x0, x23
	bl	_subctxt_fp
	cbz	w0, LBB0_13
; %bb.10:
	mov	x0, x23
	bl	_subctxt_fp
	sub	w8, w0, #1
	ldp	w10, w9, [x22, #4]
	udiv	w4, w9, w10
	ldr	w9, [x22, #12]
	ldr	w10, [x21, #8]
	mul	w8, w4, w8
	madd	w8, w8, w10, w9
	cmp	w20, w24
	b.eq	LBB0_12
	b	LBB0_14
LBB0_11:
	ldp	w4, w8, [x22, #8]
	cmp	w20, w24
	b.ne	LBB0_14
LBB0_12:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x20
	bl	_mmap_ureg
	mov	x22, x0
	b	LBB0_27
LBB0_13:
	ldp	w9, w8, [x22, #4]
	udiv	w10, w8, w9
	msub	w9, w10, w9, w8
	ldr	w11, [x22, #12]
	ldr	w12, [x21, #8]
	add	w4, w9, w10
	sub	w8, w8, w4
	madd	w8, w12, w8, w11
	cmp	w20, w24
	b.eq	LBB0_12
LBB0_14:
	cmp	w20, w8
	b.ne	LBB0_16
; %bb.15:
	mov	x0, x19
	mov	x1, x21
	mov	x2, x22
	mov	x3, x20
	bl	_mmap_piobufs
	mov	x22, x0
	b	LBB0_27
LBB0_16:
	ldr	w8, [x21, #12]
	cmp	w20, w8
	b.ne	LBB0_20
; %bb.17:
Lloh9:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh10:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh11:
	ldr	w2, [x8]
	ldr	x3, [x21, #24]
Lloh12:
	adrp	x5, l_.str@PAGE
Lloh13:
	add	x5, x5, l_.str@PAGEOFF
LBB0_18:
	mov	x0, x19
	mov	x1, x22
	mov	w4, #0
LBB0_19:
	bl	_qib_mmap_mem
	mov	x22, x0
	b	LBB0_27
LBB0_20:
	ldr	w8, [x22, #16]
	cmp	w20, w8
	b.ne	LBB0_22
; %bb.21:
	mov	x0, x19
	mov	x1, x22
	bl	_mmap_rcvegrbufs
	mov	x22, x0
	b	LBB0_27
LBB0_22:
	ldr	w8, [x22, #56]
	cmp	w20, w8
	b.ne	LBB0_24
; %bb.23:
	ldr	w2, [x22, #48]
	ldr	x3, [x22, #24]
Lloh14:
	adrp	x5, l_.str.1@PAGE
Lloh15:
	add	x5, x5, l_.str.1@PAGEOFF
	mov	x0, x19
	mov	x1, x22
	mov	w4, #1
	b	LBB0_19
LBB0_24:
	ldr	w8, [x22, #40]
	cmp	w20, w8
	b.ne	LBB0_26
; %bb.25:
Lloh16:
	adrp	x8, _PAGE_SIZE@GOTPAGE
Lloh17:
	ldr	x8, [x8, _PAGE_SIZE@GOTPAGEOFF]
Lloh18:
	ldr	w2, [x8]
	ldr	x3, [x22, #32]
Lloh19:
	adrp	x5, l_.str.2@PAGE
Lloh20:
	add	x5, x5, l_.str.2@PAGEOFF
	b	LBB0_18
LBB0_26:
Lloh21:
	adrp	x8, _EINVAL@GOTPAGE
Lloh22:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh23:
	ldr	w8, [x8]
	neg	w22, w8
LBB0_27:
	str	xzr, [x19, #24]
	tbz	w22, #31, LBB0_6
; %bb.28:
	ldr	w0, [x21, #16]
	neg	w2, w22
	ldp	x9, x8, [x19, #8]
	sub	x4, x8, x9
Lloh24:
	adrp	x1, l_.str.3@PAGE
Lloh25:
	add	x1, x1, l_.str.3@PAGEOFF
	mov	x3, x20
	bl	_qib_devinfo
	b	LBB0_6
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh9, Lloh10, Lloh11
	.loh AdrpAdd	Lloh14, Lloh15
	.loh AdrpAdd	Lloh19, Lloh20
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.loh AdrpLdrGotLdr	Lloh21, Lloh22, Lloh23
	.loh AdrpAdd	Lloh24, Lloh25
	.cfi_endproc
                                        ; -- End function
	.comm	_VM_SHARED,4,2                  ; @VM_SHARED
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_PAGE_SHIFT,4,2                 ; @PAGE_SHIFT
	.comm	_PAGE_SIZE,4,2                  ; @PAGE_SIZE
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"pioavail registers"

l_.str.1:                               ; @.str.1
	.asciz	"rcvhdrq"

l_.str.2:                               ; @.str.2
	.asciz	"rcvhdrq tail"

l_.str.3:                               ; @.str.3
	.asciz	"mmap Failure %d: off %llx len %lx\n"

	.no_dead_strip	_qib_mmapf
.subsections_via_symbols
