	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_riomap                         ## -- Begin function riomap
	.p2align	4, 0x90
_riomap:                                ## @riomap
	.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	$24, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r9d, -52(%rbp)                 ## 4-byte Spill
	movl	%ecx, %ebx
	movq	%rdx, -64(%rbp)                 ## 8-byte Spill
	movq	%rsi, %r13
	movl	%edi, %esi
	movq	_IBV_ACCESS_LOCAL_WRITE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	movq	_idm@GOTPCREL(%rip), %rdi
	callq	_idm_at
	movq	%rax, %r15
	movq	16(%rax), %rax
	cmpl	$0, (%rax)
	je	LBB0_13
## %bb.1:
	movq	_PROT_WRITE@GOTPCREL(%rip), %r12
	movq	_PROT_NONE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	orl	(%r12), %eax
	notl	%eax
	testl	%ebx, %eax
	je	LBB0_2
LBB0_13:
	movq	_EINVAL@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_ERR                            ## TAILCALL
LBB0_2:
	leaq	4(%r15), %rdi
	movq	%rdi, -48(%rbp)                 ## 8-byte Spill
	callq	_fastlock_acquire
	testl	%ebx, (%r12)
	je	LBB0_3
## %bb.4:
	movq	%r15, %rdi
	callq	_rs_get_iomap_mr
	testq	%rax, %rax
	je	LBB0_14
## %bb.5:
	movq	%rax, %r12
	movq	_IBV_ACCESS_REMOTE_WRITE@GOTPCREL(%rip), %rax
	orl	(%rax), %r14d
	jmp	LBB0_6
LBB0_3:
	movl	$1, %edi
	movl	$20, %esi
	callq	_calloc
	movq	%rax, %r12
	movl	$-1, (%rax)
LBB0_6:
	movq	16(%r15), %rax
	movl	(%rax), %edi
	movq	%r13, %rsi
	movq	-64(%rbp), %rdx                 ## 8-byte Reload
	movl	%r14d, %ecx
	callq	_ibv_reg_mr
	movl	%eax, 16(%r12)
	testl	%eax, %eax
	je	LBB0_7
## %bb.9:
	movl	-52(%rbp), %eax                 ## 4-byte Reload
	cmpl	$-1, %eax
	cmovnel	%eax, %r13d
	movl	%r13d, 4(%r12)
	leaq	12(%r12), %rdi
	movl	$1, %esi
	callq	_atomic_store
	leaq	8(%r12), %rdi
	cmpl	$0, (%r12)
	js	LBB0_11
## %bb.10:
	movq	%r15, %rsi
	addq	$12, %rsi
	callq	_dlist_insert_tail
	movl	$1, (%r15)
	jmp	LBB0_12
LBB0_7:
	movl	$-1, %r13d
	cmpl	$0, (%r12)
	jns	LBB0_12
## %bb.8:
	movq	%r12, %rdi
	callq	_free
	jmp	LBB0_12
LBB0_14:
	movq	_ENOMEM@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ERR
	movl	%eax, %r13d
	jmp	LBB0_12
LBB0_11:
	addq	$8, %r15
	movq	%r15, %rsi
	callq	_dlist_insert_tail
LBB0_12:
	movq	-48(%rbp), %rdi                 ## 8-byte Reload
	callq	_fastlock_release
	movl	%r13d, %eax
	addq	$24, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_IBV_ACCESS_LOCAL_WRITE,4,2     ## @IBV_ACCESS_LOCAL_WRITE
	.comm	_idm,4,2                        ## @idm
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_PROT_NONE,4,2                  ## @PROT_NONE
	.comm	_EINVAL,4,2                     ## @EINVAL
	.comm	_IBV_ACCESS_REMOTE_WRITE,4,2    ## @IBV_ACCESS_REMOTE_WRITE
	.comm	_ENOMEM,4,2                     ## @ENOMEM
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_riomap                         ; -- Begin function riomap
	.p2align	2
_riomap:                                ; @riomap
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.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
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	mov	x21, x5
	mov	x25, x3
	mov	x23, x2
	mov	x22, x1
	mov	x1, x0
Lloh0:
	adrp	x8, _IBV_ACCESS_LOCAL_WRITE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _IBV_ACCESS_LOCAL_WRITE@GOTPAGEOFF]
Lloh2:
	ldr	w24, [x8]
Lloh3:
	adrp	x0, _idm@GOTPAGE
Lloh4:
	ldr	x0, [x0, _idm@GOTPAGEOFF]
	bl	_idm_at
	ldr	x8, [x0, #16]
	ldr	w8, [x8]
	cbz	w8, LBB0_2
; %bb.1:
Lloh5:
	adrp	x26, _PROT_WRITE@GOTPAGE
Lloh6:
	ldr	x26, [x26, _PROT_WRITE@GOTPAGEOFF]
	ldr	w8, [x26]
Lloh7:
	adrp	x9, _PROT_NONE@GOTPAGE
Lloh8:
	ldr	x9, [x9, _PROT_NONE@GOTPAGEOFF]
Lloh9:
	ldr	w9, [x9]
	orr	w8, w9, w8
	bics	wzr, w25, w8
	b.eq	LBB0_3
LBB0_2:
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
Lloh12:
	ldr	w0, [x8]
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	b	_ERR
LBB0_3:
	mov	x20, x0
	add	x19, x0, #4
	mov	x0, x19
	bl	_fastlock_acquire
	ldr	w8, [x26]
	tst	w8, w25
	b.eq	LBB0_6
; %bb.4:
	mov	x0, x20
	bl	_rs_get_iomap_mr
	cbz	x0, LBB0_13
; %bb.5:
	mov	x25, x0
Lloh13:
	adrp	x8, _IBV_ACCESS_REMOTE_WRITE@GOTPAGE
Lloh14:
	ldr	x8, [x8, _IBV_ACCESS_REMOTE_WRITE@GOTPAGEOFF]
Lloh15:
	ldr	w8, [x8]
	orr	w24, w8, w24
	b	LBB0_7
LBB0_6:
	mov	w0, #1
	mov	w1, #20
	bl	_calloc
	mov	x25, x0
	mov	w8, #-1
	str	w8, [x0]
LBB0_7:
	ldr	x8, [x20, #16]
	ldr	w0, [x8]
	mov	x1, x22
	mov	x2, x23
	mov	x3, x24
	bl	_ibv_reg_mr
	str	w0, [x25, #16]
	cbz	w0, LBB0_10
; %bb.8:
	cmn	w21, #1
	csel	w21, w22, w21, eq
	str	w21, [x25, #4]
	add	x0, x25, #12
	mov	w22, #1
	mov	w1, #1
	bl	_atomic_store
	ldr	w8, [x25]
	add	x0, x25, #8
	tbnz	w8, #31, LBB0_14
; %bb.9:
	add	x1, x20, #12
	bl	_dlist_insert_tail
	str	w22, [x20]
	b	LBB0_15
LBB0_10:
	ldr	w8, [x25]
	tbz	w8, #31, LBB0_12
; %bb.11:
	mov	x0, x25
	bl	_free
LBB0_12:
	mov	w21, #-1
	b	LBB0_15
LBB0_13:
Lloh16:
	adrp	x8, _ENOMEM@GOTPAGE
Lloh17:
	ldr	x8, [x8, _ENOMEM@GOTPAGEOFF]
Lloh18:
	ldr	w0, [x8]
	bl	_ERR
	mov	x21, x0
	b	LBB0_15
LBB0_14:
	add	x1, x20, #8
	bl	_dlist_insert_tail
LBB0_15:
	mov	x0, x19
	bl	_fastlock_release
	mov	x0, x21
	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
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh7, Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh5, Lloh6
	.loh AdrpLdrGotLdr	Lloh10, Lloh11, Lloh12
	.loh AdrpLdrGotLdr	Lloh13, Lloh14, Lloh15
	.loh AdrpLdrGotLdr	Lloh16, Lloh17, Lloh18
	.cfi_endproc
                                        ; -- End function
	.comm	_IBV_ACCESS_LOCAL_WRITE,4,2     ; @IBV_ACCESS_LOCAL_WRITE
	.comm	_idm,4,2                        ; @idm
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_PROT_NONE,4,2                  ; @PROT_NONE
	.comm	_EINVAL,4,2                     ; @EINVAL
	.comm	_IBV_ACCESS_REMOTE_WRITE,4,2    ; @IBV_ACCESS_REMOTE_WRITE
	.comm	_ENOMEM,4,2                     ; @ENOMEM
.subsections_via_symbols
