	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qc_readbytes
_qc_readbytes:                          ## @qc_readbytes
	.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
	testq	%rsi, %rsi
	je	LBB0_1
## %bb.2:
	movq	%rsi, %r14
	movq	%rdi, %rbx
	movq	_QC_MODE_MASK@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	andl	(%rdi), %eax
	cmpl	$128, %eax
	je	LBB0_8
## %bb.3:
	movq	%r14, -48(%rbp)                 ## 8-byte Spill
	movl	$1, %r15d
	cmpl	$129, %eax
	jne	LBB0_18
## %bb.4:
	movq	%rbx, %rdi
	movl	$38, %esi
	callq	_write_lpcontrol
	movl	$1, %r15d
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_qc_waithand2
	movl	%eax, %r13d
	sarl	%r13d
	movq	%rbx, %rdi
	callq	_read_lpstatus
	movl	%eax, %r14d
	movq	%rbx, %rdi
	movl	$46, %esi
	callq	_write_lpcontrol
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_qc_waithand2
	movl	%eax, %r12d
	sarl	%r12d
	movq	%rbx, %rdi
	callq	_read_lpstatus
	movl	8(%rbx), %ecx
	cmpl	$6, %ecx
	je	LBB0_7
## %bb.5:
	cmpl	$4, %ecx
	jne	LBB0_18
## %bb.6:
	movl	%r13d, %ecx
	andb	$15, %cl
	movq	-48(%rbp), %rsi                 ## 8-byte Reload
	movb	%cl, (%rsi)
	shrl	$4, %r13d
	andl	$7, %r13d
	movl	%r14d, %ecx
	andl	$8, %ecx
	orl	%r13d, %ecx
	movb	%cl, 1(%rsi)
	shrb	$4, %r14b
	movb	%r14b, 2(%rsi)
	movl	%r12d, %ecx
	andb	$15, %cl
	movb	%cl, 3(%rsi)
	shrl	$4, %r12d
	andl	$7, %r12d
	movl	%eax, %ecx
	andl	$8, %ecx
	orl	%r12d, %ecx
	movb	%cl, 4(%rsi)
	shrb	$4, %al
	movb	%al, 5(%rsi)
	movl	$6, %r15d
	jmp	LBB0_18
LBB0_1:
	movl	$0, _qc_readbytes.state(%rip)
	xorl	%r15d, %r15d
LBB0_18:
	movl	%r15d, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_8:
	movq	%rbx, %rdi
	movl	$6, %esi
	callq	_write_lpcontrol
	movl	$1, %r15d
	movq	%rbx, %rdi
	movl	$1, %esi
	callq	_qc_waithand
	movl	%eax, %r12d
	movl	%eax, %r13d
	shrl	$4, %r13d
	andl	$15, %r13d
	movq	%rbx, %rdi
	movl	$14, %esi
	callq	_write_lpcontrol
	movq	%rbx, %rdi
	xorl	%esi, %esi
	callq	_qc_waithand
	movl	%eax, %ecx
	shrl	$4, %ecx
	andl	$15, %ecx
	movl	8(%rbx), %edx
	cmpl	$6, %edx
	je	LBB0_11
## %bb.9:
	cmpl	$4, %edx
	jne	LBB0_18
## %bb.10:
	movb	%r13b, (%r14)
	movb	%cl, 1(%r14)
	jmp	LBB0_17
LBB0_7:
	movl	%r13d, %ecx
	andb	$63, %cl
	movq	-48(%rbp), %rdx                 ## 8-byte Reload
	movb	%cl, (%rdx)
	shrl	$6, %r13d
	andl	$1, %r13d
	shrl	$2, %r14d
	andl	$62, %r14d
	orl	%r13d, %r14d
	movb	%r14b, 1(%rdx)
	movl	%r12d, %ecx
	andb	$63, %cl
	movb	%cl, 2(%rdx)
	shrl	$6, %r12d
	andl	$1, %r12d
	shrl	$2, %eax
	andl	$62, %eax
	orl	%r12d, %eax
	movb	%al, 3(%rdx)
	movl	$4, %r15d
	jmp	LBB0_18
LBB0_11:
	movl	_qc_readbytes.state(%rip), %edx
	cmpl	$2, %edx
	je	LBB0_16
## %bb.12:
	cmpl	$1, %edx
	je	LBB0_15
## %bb.13:
	testl	%edx, %edx
	jne	LBB0_18
## %bb.14:
	movl	%eax, %ecx
	shrl	$6, %ecx
	andl	$3, %ecx
	leal	(%rcx,%r13,4), %ecx
	movb	%cl, (%r14)
	andl	$48, %eax
	movl	%eax, 4(%rbx)
	movl	$1, _qc_readbytes.state(%rip)
	jmp	LBB0_18
LBB0_16:
	movl	%r12d, %eax
	shrl	$6, %eax
	andl	$3, %eax
	orl	4(%rbx), %eax
	movb	%al, (%r14)
	andl	$48, %r12d
	orl	%r12d, %ecx
	movb	%cl, 1(%r14)
	movl	$0, _qc_readbytes.state(%rip)
LBB0_17:
	movl	$2, %r15d
	jmp	LBB0_18
LBB0_15:
	orl	4(%rbx), %r13d
	movb	%r13b, (%r14)
	shll	$2, %ecx
	movl	%ecx, 4(%rbx)
	movl	$2, _qc_readbytes.state(%rip)
	jmp	LBB0_18
	.cfi_endproc
                                        ## -- End function
.zerofill __DATA,__bss,_qc_readbytes.state,4,2 ## @qc_readbytes.state
	.comm	_QC_MODE_MASK,4,2               ## @QC_MODE_MASK
	.no_dead_strip	_qc_readbytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qc_readbytes
_qc_readbytes:                          ; @qc_readbytes
	.cfi_startproc
; %bb.0:
	stp	x26, x25, [sp, #-80]!           ; 16-byte Folded Spill
	.cfi_def_cfa_offset 80
	stp	x24, x23, [sp, #16]             ; 16-byte Folded Spill
	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
	.cfi_offset w23, -56
	.cfi_offset w24, -64
	.cfi_offset w25, -72
	.cfi_offset w26, -80
	cbz	x1, LBB0_6
; %bb.1:
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0]
Lloh0:
	adrp	x9, _QC_MODE_MASK@GOTPAGE
Lloh1:
	ldr	x9, [x9, _QC_MODE_MASK@GOTPAGEOFF]
Lloh2:
	ldr	w9, [x9]
	and	w8, w9, w8
	cmp	w8, #128
	b.eq	LBB0_7
; %bb.2:
	cmp	w8, #129
	b.ne	LBB0_18
; %bb.3:
	mov	x0, x20
	mov	w1, #38
	bl	_write_lpcontrol
	mov	w21, #1
	mov	x0, x20
	mov	w1, #1
	bl	_qc_waithand2
	mov	x23, x0
	asr	w25, w0, #1
	mov	x0, x20
	bl	_read_lpstatus
	mov	x22, x0
	mov	x0, x20
	mov	w1, #46
	bl	_write_lpcontrol
	mov	x0, x20
	mov	w1, #0
	bl	_qc_waithand2
	mov	x24, x0
	asr	w26, w0, #1
	mov	x0, x20
	bl	_read_lpstatus
	ldr	w8, [x20, #8]
	cmp	w8, #6
	b.eq	LBB0_10
; %bb.4:
	cmp	w8, #4
	b.ne	LBB0_19
; %bb.5:
	ubfx	w8, w23, #1, #4
	strb	w8, [x19]
	and	w8, w22, #0x8
	bfxil	w8, w25, #4, #3
	strb	w8, [x19, #1]
	ubfx	w8, w22, #4, #4
	strb	w8, [x19, #2]
	ubfx	w8, w24, #1, #4
	strb	w8, [x19, #3]
	and	w8, w0, #0x8
	bfxil	w8, w26, #4, #3
	strb	w8, [x19, #4]
	ubfx	w8, w0, #4, #4
	strb	w8, [x19, #5]
	mov	w21, #6
	b	LBB0_19
LBB0_6:
	mov	w21, #0
	adrp	x8, _qc_readbytes.state@PAGE
	str	wzr, [x8, _qc_readbytes.state@PAGEOFF]
	b	LBB0_19
LBB0_7:
	mov	x0, x20
	mov	w1, #6
	bl	_write_lpcontrol
	mov	w21, #1
	mov	x0, x20
	mov	w1, #1
	bl	_qc_waithand
	mov	x22, x0
	ubfx	w23, w0, #4, #4
	mov	x0, x20
	mov	w1, #14
	bl	_write_lpcontrol
	mov	x0, x20
	mov	w1, #0
	bl	_qc_waithand
	ubfx	w9, w0, #4, #4
	ldr	w8, [x20, #8]
	cmp	w8, #6
	b.eq	LBB0_11
; %bb.8:
	cmp	w8, #4
	b.ne	LBB0_19
; %bb.9:
	strb	w23, [x19]
	strb	w9, [x19, #1]
	b	LBB0_16
LBB0_10:
	ubfx	w8, w23, #1, #6
	strb	w8, [x19]
	lsr	w8, w22, #2
	and	w8, w8, #0x3e
	bfxil	w8, w25, #6, #1
	strb	w8, [x19, #1]
	ubfx	w8, w24, #1, #6
	strb	w8, [x19, #2]
	lsr	w8, w0, #2
	and	w8, w8, #0x3e
	bfxil	w8, w26, #6, #1
	strb	w8, [x19, #3]
	mov	w21, #4
	b	LBB0_19
LBB0_11:
	adrp	x8, _qc_readbytes.state@PAGE
	ldr	w10, [x8, _qc_readbytes.state@PAGEOFF]
	cmp	w10, #2
	b.eq	LBB0_15
; %bb.12:
	cmp	w10, #1
	b.eq	LBB0_17
; %bb.13:
	cbnz	w10, LBB0_18
; %bb.14:
	lsl	w9, w23, #2
	bfxil	w9, w0, #6, #2
	strb	w9, [x19]
	and	w9, w0, #0x30
	str	w9, [x20, #4]
	mov	w21, #1
	str	w21, [x8, _qc_readbytes.state@PAGEOFF]
	b	LBB0_19
LBB0_15:
	ubfx	w10, w22, #6, #2
	ldr	w11, [x20, #4]
	orr	w10, w11, w10
	strb	w10, [x19]
	and	w10, w22, #0x30
	orr	w9, w9, w10
	strb	w9, [x19, #1]
	str	wzr, [x8, _qc_readbytes.state@PAGEOFF]
LBB0_16:
	mov	w21, #2
	b	LBB0_19
LBB0_17:
	ldr	w10, [x20, #4]
	orr	w10, w10, w23
	strb	w10, [x19]
	lsl	w9, w9, #2
	str	w9, [x20, #4]
	mov	w9, #2
	str	w9, [x8, _qc_readbytes.state@PAGEOFF]
LBB0_18:
	mov	w21, #1
LBB0_19:
	mov	x0, x21
	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
	ldp	x24, x23, [sp, #16]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp], #80             ; 16-byte Folded Reload
	ret
	.loh AdrpLdrGotLdr	Lloh0, Lloh1, Lloh2
	.cfi_endproc
                                        ; -- End function
.zerofill __DATA,__bss,_qc_readbytes.state,4,2 ; @qc_readbytes.state
	.comm	_QC_MODE_MASK,4,2               ; @QC_MODE_MASK
	.no_dead_strip	_qc_readbytes
.subsections_via_symbols
