	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_riowrite                       ## -- Begin function riowrite
	.p2align	4, 0x90
_riowrite:                              ## @riowrite
	.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	$88, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%r8d, %r12d
	movq	%rcx, -48(%rbp)                 ## 8-byte Spill
	movq	%rdx, %r15
	movq	%rsi, -64(%rbp)                 ## 8-byte Spill
	movl	%edi, %esi
	movq	_RS_OLAP_START_SIZE@GOTPCREL(%rip), %rax
	movq	(%rax), %rax
	movq	%rax, -80(%rbp)                 ## 8-byte Spill
	movq	_idm@GOTPCREL(%rip), %rdi
	callq	_idm_at
	movq	%rax, %r14
	leaq	32(%rax), %rdi
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	callq	_fastlock_acquire
	cmpq	$0, 48(%r14)
	je	LBB0_2
## %bb.1:
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_rs_send_iomaps
	movl	%eax, %r13d
	movq	%r15, %rbx
	testl	%eax, %eax
	jne	LBB0_26
LBB0_2:
	testq	%r15, %r15
	je	LBB0_3
## %bb.4:
	movq	%r15, %rbx
	xorl	%r15d, %r15d
	movq	%rbx, -56(%rbp)                 ## 8-byte Spill
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	%r12d, -68(%rbp)                ## 4-byte Spill
	.p2align	4, 0x90
LBB0_5:                                 ## =>This Inner Loop Header: Depth=1
	testq	%r15, %r15
	je	LBB0_7
## %bb.6:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	8(%r15), %rax
	addq	(%r15), %rax
	cmpq	%rax, %r13
	jle	LBB0_8
LBB0_7:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	movq	%r13, %rsi
	callq	_rs_find_iomap
	movq	%rax, %r15
	testq	%rax, %rax
	je	LBB0_24
LBB0_8:                                 ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	callq	_rs_can_send
	testl	%eax, %eax
	movq	%rbx, -48(%rbp)                 ## 8-byte Spill
	jne	LBB0_13
## %bb.9:                               ##   in Loop: Header=BB0_5 Depth=1
	movq	%r13, %rbx
	movq	%r14, %rdi
	movl	%r12d, %esi
	callq	_rs_nonblocking
	movq	_rs_conn_can_send@GOTPCREL(%rip), %rcx
	movl	(%rcx), %edx
	movq	%r14, %rdi
	movl	%eax, %esi
	callq	_rs_get_comp
	testl	%eax, %eax
	jne	LBB0_10
## %bb.11:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	_rs_writable@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	testl	%eax, (%r14)
	movq	%rbx, %r13
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	je	LBB0_12
LBB0_13:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-80(%rbp), %rsi                 ## 8-byte Reload
	movq	_RS_MAX_TRANSFER@GOTPCREL(%rip), %rax
	cmpq	(%rax), %rsi
	setb	%al
	cmpq	%rbx, %rsi
	setb	%cl
	movq	%rbx, %rdx
	cmovbq	%rsi, %rdx
	andb	%al, %cl
	shlq	%cl, %rsi
	movq	%rsi, -80(%rbp)                 ## 8-byte Spill
	movq	8(%r14), %rax
	cmpq	%rax, %rdx
	cmovaeq	%rax, %rdx
	movq	(%r15), %r12
	subq	%r13, %r12
	addq	8(%r15), %r12
	cmpq	%r12, %rdx
	cmovbq	%rdx, %r12
	cmpq	16(%r14), %r12
	jbe	LBB0_14
## %bb.15:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	callq	_rs_sbuf_left
	cmpq	%rax, %r12
	jbe	LBB0_16
## %bb.19:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	%r14, %rdi
	callq	_rs_sbuf_left
	movq	40(%r14), %rcx
	movq	%rax, 8(%rcx)
	movq	(%rcx), %rdi
	movq	-64(%rbp), %rbx                 ## 8-byte Reload
	movq	%rbx, %rsi
	movq	%rax, %rdx
	callq	_memcpy
	movq	40(%r14), %rax
	movq	8(%rax), %rsi
	movq	%r12, %rdx
	subq	%rsi, %rdx
	movq	%rdx, 32(%rax)
	movq	24(%r14), %rdi
	addq	%rbx, %rsi
	callq	_memcpy
	movq	40(%r14), %rcx
	movl	$0, (%rsp)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r13, %rbx
	movq	%r13, %rdx
	movl	$2, %r8d
	movq	%r12, %r9
	callq	_rs_write_direct
	movl	%eax, %r13d
	movq	40(%r14), %rax
	movq	32(%rax), %rcx
	addq	24(%r14), %rcx
	movq	%rcx, (%rax)
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_14:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	-64(%rbp), %rax                 ## 8-byte Reload
	movq	%rax, -112(%rbp)
	movq	%r12, -104(%rbp)
	movq	$0, -96(%rbp)
	movq	_IBV_SEND_INLINE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	movl	%eax, (%rsp)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r13, %rbx
	movq	%r13, %rdx
	leaq	-112(%rbp), %rcx
	movl	$1, %r8d
	movq	%r12, %r9
	callq	_rs_write_direct
	movl	%eax, %r13d
	jmp	LBB0_20
	.p2align	4, 0x90
LBB0_16:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	40(%r14), %rax
	movq	(%rax), %rdi
	movq	-64(%rbp), %rsi                 ## 8-byte Reload
	movq	%r12, %rdx
	callq	_memcpy
	movq	40(%r14), %rcx
	movq	%r12, 8(%rcx)
	movl	$0, (%rsp)
	movq	%r14, %rdi
	movq	%r15, %rsi
	movq	%r13, %rbx
	movq	%r13, %rdx
	movl	$1, %r8d
	movq	%r12, %r9
	callq	_rs_write_direct
	movl	%eax, %r13d
	movq	%r14, %rdi
	callq	_rs_sbuf_left
	cmpq	%rax, %r12
	jae	LBB0_18
## %bb.17:                              ##   in Loop: Header=BB0_5 Depth=1
	movq	40(%r14), %rax
	addq	%r12, (%rax)
	jmp	LBB0_20
LBB0_18:                                ##   in Loop: Header=BB0_5 Depth=1
	movq	24(%r14), %rax
	movq	40(%r14), %rcx
	movq	%rax, (%rcx)
	.p2align	4, 0x90
LBB0_20:                                ##   in Loop: Header=BB0_5 Depth=1
	testl	%r13d, %r13d
	jne	LBB0_21
## %bb.22:                              ##   in Loop: Header=BB0_5 Depth=1
	addq	%r12, -64(%rbp)                 ## 8-byte Folded Spill
	movq	%rbx, %r13
	addq	%r12, %r13
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
	subq	%r12, %rbx
	movl	-68(%rbp), %r12d                ## 4-byte Reload
	jne	LBB0_5
## %bb.23:
	xorl	%ebx, %ebx
LBB0_24:
	xorl	%r13d, %r13d
LBB0_25:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	jmp	LBB0_26
LBB0_3:
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	jmp	LBB0_26
LBB0_10:
	movl	%eax, %r13d
LBB0_21:
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movq	-48(%rbp), %rbx                 ## 8-byte Reload
LBB0_26:
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	callq	_fastlock_release
	subq	%rbx, %r15
	movslq	%r13d, %rcx
	movq	%r15, %rax
	cmoveq	%rcx, %rax
	testl	%ecx, %ecx
	cmoveq	%r15, %rax
	addq	$88, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_12:
	movq	_ECONNRESET@GOTPCREL(%rip), %rax
	movl	(%rax), %edi
	callq	_ERR
	movl	%eax, %r13d
	jmp	LBB0_25
	.cfi_endproc
                                        ## -- End function
	.comm	_RS_OLAP_START_SIZE,8,3         ## @RS_OLAP_START_SIZE
	.comm	_idm,4,2                        ## @idm
	.comm	_rs_conn_can_send,4,2           ## @rs_conn_can_send
	.comm	_rs_writable,4,2                ## @rs_writable
	.comm	_ECONNRESET,4,2                 ## @ECONNRESET
	.comm	_RS_MAX_TRANSFER,8,3            ## @RS_MAX_TRANSFER
	.comm	_IBV_SEND_INLINE,4,2            ## @IBV_SEND_INLINE
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_riowrite                       ; -- Begin function riowrite
	.p2align	2
_riowrite:                              ; @riowrite
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #144
	.cfi_def_cfa_offset 144
	stp	x28, x27, [sp, #48]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #64]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #80]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #96]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #112]            ; 16-byte Folded Spill
	stp	x29, x30, [sp, #128]            ; 16-byte Folded Spill
	add	x29, sp, #128
	.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
	.cfi_offset w27, -88
	.cfi_offset w28, -96
	mov	x25, x4
	mov	x22, x3
	mov	x20, x2
	mov	x23, x1
	mov	x1, x0
Lloh0:
	adrp	x8, _RS_OLAP_START_SIZE@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RS_OLAP_START_SIZE@GOTPAGEOFF]
Lloh2:
	ldr	x28, [x8]
Lloh3:
	adrp	x0, _idm@GOTPAGE
Lloh4:
	ldr	x0, [x0, _idm@GOTPAGEOFF]
	bl	_idm_at
	mov	x24, x0
	add	x21, x0, #32
	mov	x0, x21
	bl	_fastlock_acquire
	ldr	x8, [x24, #48]
	cbz	x8, LBB0_2
; %bb.1:
	mov	x0, x24
	mov	x1, x25
	bl	_rs_send_iomaps
	mov	x27, x0
	mov	x19, x20
	cbnz	w0, LBB0_23
LBB0_2:
	cbz	x20, LBB0_22
; %bb.3:
	str	w25, [sp, #20]                  ; 4-byte Folded Spill
	stp	x21, x20, [sp]                  ; 16-byte Folded Spill
	mov	x25, #0
	mov	x19, x20
LBB0_4:                                 ; =>This Inner Loop Header: Depth=1
	cbz	x25, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_4 Depth=1
	ldp	x8, x9, [x25]
	add	x8, x9, x8
	cmp	x22, x8
	b.le	LBB0_7
LBB0_6:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	mov	x1, x22
	bl	_rs_find_iomap
	mov	x25, x0
	cbz	x0, LBB0_20
LBB0_7:                                 ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_rs_can_send
	cbnz	w0, LBB0_10
; %bb.8:                                ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	ldr	w1, [sp, #20]                   ; 4-byte Folded Reload
	bl	_rs_nonblocking
	mov	x1, x0
Lloh5:
	adrp	x8, _rs_conn_can_send@GOTPAGE
Lloh6:
	ldr	x8, [x8, _rs_conn_can_send@GOTPAGEOFF]
Lloh7:
	ldr	w2, [x8]
	mov	x0, x24
	bl	_rs_get_comp
	cbnz	w0, LBB0_24
; %bb.9:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	w8, [x24]
Lloh8:
	adrp	x9, _rs_writable@GOTPAGE
Lloh9:
	ldr	x9, [x9, _rs_writable@GOTPAGEOFF]
Lloh10:
	ldr	w9, [x9]
	tst	w9, w8
	b.eq	LBB0_25
LBB0_10:                                ;   in Loop: Header=BB0_4 Depth=1
Lloh11:
	adrp	x8, _RS_MAX_TRANSFER@GOTPAGE
Lloh12:
	ldr	x8, [x8, _RS_MAX_TRANSFER@GOTPAGEOFF]
Lloh13:
	ldr	x8, [x8]
	cmp	x28, x8
	cset	w21, lo
	cmp	x28, x19
	csel	x8, x28, x19, lo
	cset	w20, lo
	ldp	x9, x10, [x24, #8]
	cmp	x8, x9
	csel	x8, x8, x9, lo
	ldp	x9, x11, [x25]
	sub	x9, x9, x22
	add	x9, x9, x11
	cmp	x8, x9
	csel	x26, x8, x9, lo
	cmp	x26, x10
	b.ls	LBB0_13
; %bb.11:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_rs_sbuf_left
	cmp	x26, x0
	b.ls	LBB0_14
; %bb.12:                               ;   in Loop: Header=BB0_4 Depth=1
	mov	x0, x24
	bl	_rs_sbuf_left
	mov	x2, x0
	ldr	x8, [x24, #40]
	str	x0, [x8, #8]
	ldr	x0, [x8]
	mov	x1, x23
	bl	_memcpy
	ldr	x8, [x24, #40]
	ldr	x9, [x8, #8]
	sub	x2, x26, x9
	str	x2, [x8, #32]
	ldr	x0, [x24, #24]
	add	x1, x23, x9
	bl	_memcpy
	ldr	x3, [x24, #40]
	mov	x0, x24
	mov	x1, x25
	mov	x2, x22
	mov	w4, #2
	mov	x5, x26
	mov	w6, #0
	bl	_rs_write_direct
	mov	x27, x0
	ldr	x8, [x24, #24]
	ldr	x9, [x24, #40]
	ldr	x10, [x9, #32]
	add	x8, x10, x8
	b	LBB0_17
LBB0_13:                                ;   in Loop: Header=BB0_4 Depth=1
	stp	x23, x26, [sp, #24]
	str	xzr, [sp, #40]
Lloh14:
	adrp	x8, _IBV_SEND_INLINE@GOTPAGE
Lloh15:
	ldr	x8, [x8, _IBV_SEND_INLINE@GOTPAGEOFF]
Lloh16:
	ldr	w6, [x8]
	add	x3, sp, #24
	mov	x0, x24
	mov	x1, x25
	mov	x2, x22
	mov	w4, #1
	mov	x5, x26
	bl	_rs_write_direct
	mov	x27, x0
	b	LBB0_18
LBB0_14:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24, #40]
	ldr	x0, [x8]
	mov	x1, x23
	mov	x2, x26
	bl	_memcpy
	ldr	x3, [x24, #40]
	str	x26, [x3, #8]
	mov	x0, x24
	mov	x1, x25
	mov	x2, x22
	mov	w4, #1
	mov	x5, x26
	mov	w6, #0
	bl	_rs_write_direct
	mov	x27, x0
	mov	x0, x24
	bl	_rs_sbuf_left
	cmp	x26, x0
	b.hs	LBB0_16
; %bb.15:                               ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24, #40]
	ldr	x9, [x8]
	add	x9, x9, x26
	str	x9, [x8]
	b	LBB0_18
LBB0_16:                                ;   in Loop: Header=BB0_4 Depth=1
	ldr	x8, [x24, #24]
	ldr	x9, [x24, #40]
LBB0_17:                                ;   in Loop: Header=BB0_4 Depth=1
	str	x8, [x9]
LBB0_18:                                ;   in Loop: Header=BB0_4 Depth=1
	cbnz	w27, LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_4 Depth=1
	and	w8, w20, w21
	lsl	x28, x28, x8
	add	x23, x23, x26
	add	x22, x26, x22
	subs	x19, x19, x26
	b.ne	LBB0_4
LBB0_20:
	mov	w27, #0
LBB0_21:
	ldp	x21, x20, [sp]                  ; 16-byte Folded Reload
	b	LBB0_23
LBB0_22:
	mov	x19, #0
	mov	w27, #0
LBB0_23:
	mov	x0, x21
	bl	_fastlock_release
	subs	x8, x20, x19
	ccmp	w27, #0, #4, eq
	sxtw	x9, w27
	csel	x0, x9, x8, ne
	ldp	x29, x30, [sp, #128]            ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #112]            ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #96]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #80]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #64]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #48]             ; 16-byte Folded Reload
	add	sp, sp, #144
	ret
LBB0_24:
	mov	x27, x0
	b	LBB0_21
LBB0_25:
Lloh17:
	adrp	x8, _ECONNRESET@GOTPAGE
Lloh18:
	ldr	x8, [x8, _ECONNRESET@GOTPAGEOFF]
Lloh19:
	ldr	w0, [x8]
	bl	_ERR
	mov	x27, x0
	b	LBB0_21
	.loh AdrpLdrGot	Lloh3, Lloh4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh5, Lloh6, Lloh7
	.loh AdrpLdrGotLdr	Lloh8, Lloh9, Lloh10
	.loh AdrpLdrGotLdr	Lloh11, Lloh12, Lloh13
	.loh AdrpLdrGotLdr	Lloh14, Lloh15, Lloh16
	.loh AdrpLdrGotLdr	Lloh17, Lloh18, Lloh19
	.cfi_endproc
                                        ; -- End function
	.comm	_RS_OLAP_START_SIZE,8,3         ; @RS_OLAP_START_SIZE
	.comm	_idm,4,2                        ; @idm
	.comm	_rs_conn_can_send,4,2           ; @rs_conn_can_send
	.comm	_rs_writable,4,2                ; @rs_writable
	.comm	_ECONNRESET,4,2                 ; @ECONNRESET
	.comm	_RS_MAX_TRANSFER,8,3            ; @RS_MAX_TRANSFER
	.comm	_IBV_SEND_INLINE,4,2            ; @IBV_SEND_INLINE
.subsections_via_symbols
