	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function r_io_mmap_write
_r_io_mmap_write:                       ## @r_io_mmap_write
	.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
	movl	$-1, %r13d
	testq	%rdi, %rdi
	je	LBB0_10
## %bb.1:
	testq	%rsi, %rsi
	je	LBB0_10
## %bb.2:
	movq	%rdx, %r15
	testq	%rdx, %rdx
	je	LBB0_10
## %bb.3:
	movq	(%rsi), %r12
	testq	%r12, %r12
	je	LBB0_10
## %bb.4:
	movq	_R_PERM_W@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r12)
	je	LBB0_10
## %bb.5:
	movl	%ecx, %r14d
	movq	%rdi, %rbx
	movslq	%ecx, %r13
	addq	(%rdi), %r13
	movl	8(%r12), %edi
	callq	_r_buf_size
	cmpq	%rax, %r13
	jg	LBB0_7
## %bb.6:
	movl	8(%r12), %edi
	callq	_r_buf_size
	testq	%rax, %rax
	jne	LBB0_8
LBB0_7:
	movl	4(%r12), %edi
	movq	%r13, %rsi
	callq	_r_file_truncate
LBB0_8:
	movl	4(%r12), %edi
	movq	(%rbx), %rsi
	movq	%r15, %rdx
	movl	%r14d, %ecx
	callq	_r_file_mmap_write
	movl	%eax, %r13d
	movq	%r12, %rdi
	callq	_r_io_mmap_refresh_buf
	testl	%eax, %eax
	jne	LBB0_10
## %bb.9:
	leaq	L_.str(%rip), %rdi
	callq	_eprintf
LBB0_10:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
	.cfi_endproc
                                        ## -- End function
	.comm	_R_PERM_W,4,2                   ## @R_PERM_W
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"io_mmap: failed to refresh the mmap backed buffer.\n"

	.no_dead_strip	_r_io_mmap_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function r_io_mmap_write
_r_io_mmap_write:                       ; @r_io_mmap_write
	.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	w23, #-1
	cbz	x0, LBB0_11
; %bb.1:
	cbz	x1, LBB0_11
; %bb.2:
	mov	x20, x2
	mov	w23, #-1
	cbz	x2, LBB0_11
; %bb.3:
	ldr	x22, [x1]
	cbz	x22, LBB0_11
; %bb.4:
	ldr	w8, [x22]
Lloh0:
	adrp	x9, _R_PERM_W@GOTPAGE
Lloh1:
	ldr	x9, [x9, _R_PERM_W@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_10
; %bb.5:
	mov	x19, x3
	mov	x21, x0
	ldr	x8, [x0]
	add	x23, x8, w3, sxtw
	ldr	w0, [x22, #8]
	bl	_r_buf_size
	cmp	x23, x0
	b.gt	LBB0_7
; %bb.6:
	ldr	w0, [x22, #8]
	bl	_r_buf_size
	cbnz	x0, LBB0_8
LBB0_7:
	ldr	w0, [x22, #4]
	mov	x1, x23
	bl	_r_file_truncate
LBB0_8:
	ldr	w0, [x22, #4]
	ldr	x1, [x21]
	mov	x2, x20
	mov	x3, x19
	bl	_r_file_mmap_write
	mov	x23, x0
	mov	x0, x22
	bl	_r_io_mmap_refresh_buf
	cbnz	w0, LBB0_11
; %bb.9:
Lloh3:
	adrp	x0, l_.str@PAGE
Lloh4:
	add	x0, x0, l_.str@PAGEOFF
	bl	_eprintf
	b	LBB0_11
LBB0_10:
	mov	w23, #-1
LBB0_11:
	mov	x0, x23
	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
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpAdd	Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_R_PERM_W,4,2                   ; @R_PERM_W
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"io_mmap: failed to refresh the mmap backed buffer.\n"

	.no_dead_strip	_r_io_mmap_write
.subsections_via_symbols
