	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function do_mmap_op
_do_mmap_op:                            ## @do_mmap_op
	.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
	movq	%rdi, %rbx
	cmpq	$0, (%rdi)
	jne	LBB0_5
## %bb.1:
	movq	_O_RDWR@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	leaq	L_.str(%rip), %rdi
	callq	_open
	movl	%eax, 8(%rbx)
	testl	%eax, %eax
	jle	LBB0_9
## %bb.2:
	xorl	%eax, %eax
	callq	_get_memory_size
	movq	_PROT_READ@GOTPCREL(%rip), %rcx
	movq	_PROT_WRITE@GOTPCREL(%rip), %rdx
	movl	(%rdx), %edx
	orl	(%rcx), %edx
	movq	_MAP_SHARED@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	8(%rbx), %r8d
	xorl	%edi, %edi
	movl	%eax, %esi
	xorl	%r9d, %r9d
	callq	_mmap
	movq	%rax, 16(%rbx)
	movq	_MAP_FAILED@GOTPCREL(%rip), %rcx
	cmpq	(%rcx), %rax
	je	LBB0_3
LBB0_5:
	cmpq	$0, 24(%rbx)
	je	LBB0_6
LBB0_9:
	popq	%rbx
	popq	%r14
	popq	%rbp
	retq
LBB0_6:
	movq	16(%rbx), %r14
	xorl	%eax, %eax
	callq	_get_memory_size
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_munmap
	cmpl	$-1, %eax
	je	LBB0_7
## %bb.8:
	movl	8(%rbx), %edi
	popq	%rbx
	popq	%r14
	popq	%rbp
	jmp	_close                          ## TAILCALL
LBB0_7:
	leaq	L_.str.2(%rip), %rdi
	jmp	LBB0_4
LBB0_3:
	leaq	L_.str.1(%rip), %rdi
LBB0_4:
	callq	_RARCH_ERR
	movl	$1, %edi
	callq	_exit
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"/dev/uio0"

	.comm	_O_RDWR,4,2                     ## @O_RDWR
	.comm	_PROT_READ,4,2                  ## @PROT_READ
	.comm	_PROT_WRITE,4,2                 ## @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ## @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ## @MAP_FAILED
L_.str.1:                               ## @.str.1
	.asciz	"could not mmap() memory\n"

L_.str.2:                               ## @.str.2
	.asciz	"could not munmap() memory\n"

	.no_dead_strip	_do_mmap_op
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function do_mmap_op
_do_mmap_op:                            ; @do_mmap_op
	.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	x19, x0
	ldr	x8, [x0]
	cbnz	x8, LBB0_3
; %bb.1:
Lloh0:
	adrp	x8, _O_RDWR@GOTPAGE
Lloh1:
	ldr	x8, [x8, _O_RDWR@GOTPAGEOFF]
Lloh2:
	ldr	w1, [x8]
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_open
	str	w0, [x19, #8]
	cmp	w0, #1
	b.lt	LBB0_4
; %bb.2:
	bl	_get_memory_size
	mov	x1, x0
Lloh5:
	adrp	x8, _PROT_READ@GOTPAGE
Lloh6:
	ldr	x8, [x8, _PROT_READ@GOTPAGEOFF]
Lloh7:
	ldr	w8, [x8]
Lloh8:
	adrp	x9, _PROT_WRITE@GOTPAGE
Lloh9:
	ldr	x9, [x9, _PROT_WRITE@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	orr	w2, w9, w8
Lloh11:
	adrp	x8, _MAP_SHARED@GOTPAGE
Lloh12:
	ldr	x8, [x8, _MAP_SHARED@GOTPAGEOFF]
Lloh13:
	ldr	w3, [x8]
	ldr	w4, [x19, #8]
	mov	x0, #0
	mov	w5, #0
	bl	_mmap
	str	x0, [x19, #16]
Lloh14:
	adrp	x8, _MAP_FAILED@GOTPAGE
Lloh15:
	ldr	x8, [x8, _MAP_FAILED@GOTPAGEOFF]
Lloh16:
	ldr	x8, [x8]
	cmp	x0, x8
	b.eq	LBB0_8
LBB0_3:
	ldr	x8, [x19, #24]
	cbz	x8, LBB0_5
LBB0_4:
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	ret
LBB0_5:
	ldr	x20, [x19, #16]
	bl	_get_memory_size
	mov	x1, x0
	mov	x0, x20
	bl	_munmap
	cmn	w0, #1
	b.eq	LBB0_7
; %bb.6:
	ldr	w0, [x19, #8]
	ldp	x29, x30, [sp, #16]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp], #32             ; 16-byte Folded Reload
	b	_close
LBB0_7:
Lloh17:
	adrp	x0, l_.str.2@PAGE
Lloh18:
	add	x0, x0, l_.str.2@PAGEOFF
	b	LBB0_9
LBB0_8:
Lloh19:
	adrp	x0, l_.str.1@PAGE
Lloh20:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_9:
	bl	_RARCH_ERR
	mov	w0, #1
	bl	_exit
	.loh AdrpAdd	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpAdd	Lloh17, Lloh18
	.loh AdrpAdd	Lloh19, Lloh20
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"/dev/uio0"

	.comm	_O_RDWR,4,2                     ; @O_RDWR
	.comm	_PROT_READ,4,2                  ; @PROT_READ
	.comm	_PROT_WRITE,4,2                 ; @PROT_WRITE
	.comm	_MAP_SHARED,4,2                 ; @MAP_SHARED
	.comm	_MAP_FAILED,8,3                 ; @MAP_FAILED
l_.str.1:                               ; @.str.1
	.asciz	"could not mmap() memory\n"

l_.str.2:                               ; @.str.2
	.asciz	"could not munmap() memory\n"

	.no_dead_strip	_do_mmap_op
.subsections_via_symbols
