	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function remote_fileio_func_write
_remote_fileio_func_write:              ## @remote_fileio_func_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	%r12
	pushq	%rbx
	subq	$32, %rsp
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movq	%rdi, -48(%rbp)
	leaq	-48(%rbp), %rdi
	leaq	-40(%rbp), %rsi
	callq	_remote_fileio_extract_int
	testq	%rax, %rax
	je	LBB0_2
LBB0_1:
	xorl	%eax, %eax
	callq	_remote_fileio_ioerror
LBB0_17:
	addq	$32, %rsp
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_2:
	movl	-40(%rbp), %edi
	callq	_remote_fileio_map_fd
	movl	%eax, %ebx
	movq	_FIO_FD_INVALID@GOTPCREL(%rip), %rax
	cmpl	(%rax), %ebx
	jne	LBB0_4
LBB0_3:
	xorl	%eax, %eax
	callq	_remote_fileio_badfd
	jmp	LBB0_17
LBB0_4:
	leaq	-48(%rbp), %rdi
	leaq	-56(%rbp), %rsi
	callq	_remote_fileio_extract_long
	testq	%rax, %rax
	jne	LBB0_1
## %bb.5:
	movq	-56(%rbp), %r12
	leaq	-48(%rbp), %rdi
	leaq	-64(%rbp), %rsi
	callq	_remote_fileio_extract_int
	testq	%rax, %rax
	jne	LBB0_1
## %bb.6:
	movq	-64(%rbp), %r15
	movq	%r15, %rdi
	callq	_xmalloc
	movq	%rax, %r14
	movq	%r12, %rdi
	movq	%rax, %rsi
	movq	%r15, %rdx
	callq	_remote_read_bytes
	cltq
	cmpq	%rax, %r15
	jne	LBB0_7
## %bb.8:
	movq	_remote_fio_no_longjmp@GOTPCREL(%rip), %rax
	movl	$1, (%rax)
	cmpl	$128, %ebx
	je	LBB0_13
## %bb.9:
	cmpl	$129, %ebx
	je	LBB0_3
## %bb.10:
	movl	%ebx, %edi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_write
	movl	%eax, %r15d
	testl	%eax, %eax
	jns	LBB0_15
## %bb.11:
	movq	_errno@GOTPCREL(%rip), %rax
	movl	(%rax), %ecx
	movq	_EACCES@GOTPCREL(%rip), %rdx
	cmpl	(%rdx), %ecx
	jne	LBB0_14
## %bb.12:
	movq	_EBADF@GOTPCREL(%rip), %rcx
	movl	(%rcx), %ecx
	movl	%ecx, (%rax)
	jmp	LBB0_14
LBB0_7:
	movq	%r14, %rdi
	callq	_xfree
	jmp	LBB0_1
LBB0_13:
	cmpq	$1, -40(%rbp)
	movq	_gdb_stdtarg@GOTPCREL(%rip), %r12
	movq	_gdb_stdtargerr@GOTPCREL(%rip), %rbx
	movq	%rbx, %rax
	cmoveq	%r12, %rax
	movl	(%rax), %edi
	movq	%r14, %rsi
	movq	%r15, %rdx
	callq	_ui_file_write
	cmpq	$1, -40(%rbp)
	cmoveq	%r12, %rbx
	movl	(%rbx), %edi
	callq	_gdb_flush
	testl	%r15d, %r15d
	js	LBB0_14
LBB0_15:
	movl	%r15d, %edi
	callq	_remote_fileio_return_success
	jmp	LBB0_16
LBB0_14:
	movl	$-1, %edi
	callq	_remote_fileio_return_errno
LBB0_16:
	movq	%r14, %rdi
	callq	_xfree
	jmp	LBB0_17
	.cfi_endproc
                                        ## -- End function
	.comm	_FIO_FD_INVALID,4,2             ## @FIO_FD_INVALID
	.comm	_remote_fio_no_longjmp,4,2      ## @remote_fio_no_longjmp
	.comm	_gdb_stdtarg,4,2                ## @gdb_stdtarg
	.comm	_gdb_stdtargerr,4,2             ## @gdb_stdtargerr
	.comm	_errno,4,2                      ## @errno
	.comm	_EACCES,4,2                     ## @EACCES
	.comm	_EBADF,4,2                      ## @EBADF
	.no_dead_strip	_remote_fileio_func_write
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function remote_fileio_func_write
_remote_fileio_func_write:              ; @remote_fileio_func_write
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #80
	.cfi_def_cfa_offset 80
	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
	str	x0, [sp, #24]
	add	x0, sp, #24
	add	x1, sp, #16
	bl	_remote_fileio_extract_int
	cbz	x0, LBB0_3
LBB0_1:
	bl	_remote_fileio_ioerror
LBB0_2:
	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
	add	sp, sp, #80
	ret
LBB0_3:
	ldr	w0, [sp, #16]
	bl	_remote_fileio_map_fd
Lloh0:
	adrp	x8, _FIO_FD_INVALID@GOTPAGE
Lloh1:
	ldr	x8, [x8, _FIO_FD_INVALID@GOTPAGEOFF]
Lloh2:
	ldr	w8, [x8]
	cmp	w0, w8
	b.ne	LBB0_5
LBB0_4:
	bl	_remote_fileio_badfd
	b	LBB0_2
LBB0_5:
	mov	x21, x0
	add	x0, sp, #24
	mov	x1, sp
	bl	_remote_fileio_extract_long
	cbnz	x0, LBB0_1
; %bb.6:
	ldr	x22, [sp]
	add	x0, sp, #24
	add	x1, sp, #8
	bl	_remote_fileio_extract_int
	cbnz	x0, LBB0_1
; %bb.7:
	ldr	x20, [sp, #8]
	mov	x0, x20
	bl	_xmalloc
	mov	x19, x0
	mov	x0, x22
	mov	x1, x19
	mov	x2, x20
	bl	_remote_read_bytes
	cmp	x20, w0, sxtw
	b.ne	LBB0_13
; %bb.8:
Lloh3:
	adrp	x8, _remote_fio_no_longjmp@GOTPAGE
Lloh4:
	ldr	x8, [x8, _remote_fio_no_longjmp@GOTPAGEOFF]
	mov	w9, #1
Lloh5:
	str	w9, [x8]
	cmp	w21, #128
	b.eq	LBB0_14
; %bb.9:
	cmp	w21, #129
	b.eq	LBB0_4
; %bb.10:
	mov	x0, x21
	mov	x1, x19
	mov	x2, x20
	bl	_write
	mov	x20, x0
	tbz	w0, #31, LBB0_15
; %bb.11:
Lloh6:
	adrp	x8, _errno@GOTPAGE
Lloh7:
	ldr	x8, [x8, _errno@GOTPAGEOFF]
	ldr	w9, [x8]
Lloh8:
	adrp	x10, _EACCES@GOTPAGE
Lloh9:
	ldr	x10, [x10, _EACCES@GOTPAGEOFF]
Lloh10:
	ldr	w10, [x10]
	cmp	w9, w10
	b.ne	LBB0_16
; %bb.12:
Lloh11:
	adrp	x9, _EBADF@GOTPAGE
Lloh12:
	ldr	x9, [x9, _EBADF@GOTPAGEOFF]
Lloh13:
	ldr	w9, [x9]
	str	w9, [x8]
	b	LBB0_16
LBB0_13:
	mov	x0, x19
	bl	_xfree
	bl	_remote_fileio_ioerror
	b	LBB0_2
LBB0_14:
Lloh14:
	adrp	x21, _gdb_stdtarg@GOTPAGE
Lloh15:
	ldr	x21, [x21, _gdb_stdtarg@GOTPAGEOFF]
	ldr	x8, [sp, #16]
Lloh16:
	adrp	x22, _gdb_stdtargerr@GOTPAGE
Lloh17:
	ldr	x22, [x22, _gdb_stdtargerr@GOTPAGEOFF]
	cmp	x8, #1
	csel	x8, x21, x22, eq
	ldr	w0, [x8]
	mov	x1, x19
	mov	x2, x20
	bl	_ui_file_write
	ldr	x8, [sp, #16]
	cmp	x8, #1
	csel	x8, x21, x22, eq
	ldr	w0, [x8]
	bl	_gdb_flush
	tbnz	w20, #31, LBB0_16
LBB0_15:
	mov	x0, x20
	bl	_remote_fileio_return_success
	b	LBB0_17
LBB0_16:
	mov	w0, #-1
	bl	_remote_fileio_return_errno
LBB0_17:
	mov	x0, x19
	bl	_xfree
	b	LBB0_2
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotStr	Lloh3, Lloh4, Lloh5
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGot	Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGot	Lloh16, Lloh17
	.loh AdrpLdrGot	Lloh14, Lloh15
	.cfi_endproc
                                        ; -- End function
	.comm	_FIO_FD_INVALID,4,2             ; @FIO_FD_INVALID
	.comm	_remote_fio_no_longjmp,4,2      ; @remote_fio_no_longjmp
	.comm	_gdb_stdtarg,4,2                ; @gdb_stdtarg
	.comm	_gdb_stdtargerr,4,2             ; @gdb_stdtargerr
	.comm	_errno,4,2                      ; @errno
	.comm	_EACCES,4,2                     ; @EACCES
	.comm	_EBADF,4,2                      ; @EBADF
	.no_dead_strip	_remote_fileio_func_write
.subsections_via_symbols
