	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function rds_cmd
_rds_cmd:                               ## @rds_cmd
	.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
	movq	%rcx, %r15
	movq	%rdx, %r14
	movq	%rsi, %rbx
	movq	%rdi, %r12
	callq	_rds_write
	movq	_RDS_RESET@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	cmpq	%rbx, (%rax)
	je	LBB0_10
## %bb.1:
	movq	%r12, %rdi
	callq	_rds_ack
	testq	%rax, %rax
	je	LBB0_3
LBB0_2:
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%r13d, %r13d
	subl	(%rax), %r13d
LBB0_10:
	movl	%r13d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_3:
	testq	%r15, %r15
	je	LBB0_10
## %bb.4:
	movq	%r12, %rdi
	callq	_rds_waitread
	testq	%rax, %rax
	js	LBB0_5
## %bb.6:
	xorl	%r13d, %r13d
	movq	%r14, %rdi
	xorl	%esi, %esi
	movq	%r15, %rdx
	callq	_memset
	testq	%r15, %r15
	jle	LBB0_10
## %bb.7:
	shlq	$3, %r15
	cmpq	$2, %r15
	movl	$1, %eax
	cmovgeq	%r15, %rax
	movq	%rax, %r15
	xorl	%ebx, %ebx
	xorl	%r13d, %r13d
	.p2align	4, 0x90
LBB0_8:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r12, %rdi
	callq	_rds_readcycle_nowait
	testl	%eax, %eax
	js	LBB0_2
## %bb.9:                               ##   in Loop: Header=BB0_8 Depth=1
	movl	%eax, %edi
	callq	_RDS_DATA
	movl	%ebx, %ecx
	notb	%cl
	andb	$7, %cl
	shll	%cl, %eax
	cltq
	movl	%ebx, %ecx
	andl	$-8, %ecx
	orq	%rax, (%r14,%rcx)
	incq	%rbx
	cmpq	%rbx, %r15
	jne	LBB0_8
	jmp	LBB0_10
LBB0_5:
	movl	$-1, %r13d
	jmp	LBB0_10
	.cfi_endproc
                                        ## -- End function
	.comm	_RDS_RESET,8,3                  ## @RDS_RESET
	.comm	_EIO,4,2                        ## @EIO
	.no_dead_strip	_rds_cmd
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function rds_cmd
_rds_cmd:                               ; @rds_cmd
	.cfi_startproc
; %bb.0:
	stp	x22, x21, [sp, #-48]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 48
	stp	x20, x19, [sp, #16]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #32]             ; 16-byte Folded Spill
	add	x29, sp, #32
	.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
	mov	x21, x3
	mov	x19, x2
	mov	x22, x1
	mov	x20, x0
	bl	_rds_write
Lloh0:
	adrp	x8, _RDS_RESET@GOTPAGE
Lloh1:
	ldr	x8, [x8, _RDS_RESET@GOTPAGEOFF]
Lloh2:
	ldr	x8, [x8]
	cmp	x8, x22
	b.ne	LBB0_2
LBB0_1:
	mov	w0, #0
	b	LBB0_4
LBB0_2:
	mov	x0, x20
	bl	_rds_ack
	cbz	x0, LBB0_5
LBB0_3:
Lloh3:
	adrp	x8, _EIO@GOTPAGE
Lloh4:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
Lloh5:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_4:
	ldp	x29, x30, [sp, #32]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #16]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp], #48             ; 16-byte Folded Reload
	ret
LBB0_5:
	cbz	x21, LBB0_1
; %bb.6:
	mov	x0, x20
	bl	_rds_waitread
	tbnz	x0, #63, LBB0_11
; %bb.7:
	mov	x0, x19
	mov	w1, #0
	mov	x2, x21
	bl	_memset
	cmp	x21, #1
	b.lt	LBB0_1
; %bb.8:
	mov	x22, #0
	lsl	x8, x21, #3
	cmp	x8, #1
	csinc	x21, x8, xzr, gt
LBB0_9:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x20
	bl	_rds_readcycle_nowait
	tbnz	w0, #31, LBB0_3
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=1
	bl	_RDS_DATA
	mov	x8, x0
	mov	w0, #0
	mvn	w9, w22
	and	w9, w9, #0x7
	lsl	w8, w8, w9
	ubfx	x9, x22, #3, #29
	lsl	x9, x9, #3
	ldr	x10, [x19, x9]
	sxtw	x8, w8
	orr	x8, x10, x8
	str	x8, [x19, x9]
	add	x22, x22, #1
	cmp	x21, x22
	b.ne	LBB0_9
	b	LBB0_4
LBB0_11:
	mov	w0, #-1
	b	LBB0_4
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.loh AdrpLdrGotLdr	Lloh3, Lloh4, Lloh5
	.cfi_endproc
                                        ; -- End function
	.comm	_RDS_RESET,8,3                  ; @RDS_RESET
	.comm	_EIO,4,2                        ; @EIO
	.no_dead_strip	_rds_cmd
.subsections_via_symbols
