	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function qcam_read_bytes
_qcam_read_bytes:                       ## @qcam_read_bytes
	.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	$56, %rsp
	.cfi_offset %rbx, -56
	.cfi_offset %r12, -48
	.cfi_offset %r13, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	movl	%edx, %r14d
	movq	%rsi, %r12
	movq	%rdi, %r15
	xorl	%r13d, %r13d
	xorl	%esi, %esi
	callq	_qcam_set_ack
	cmpq	$0, 8(%r15)
	movl	%r14d, -60(%rbp)                ## 4-byte Spill
	movq	%r15, -56(%rbp)                 ## 8-byte Spill
	je	LBB0_7
## %bb.1:
	testl	%r14d, %r14d
	je	LBB0_6
## %bb.2:
	xorl	%r13d, %r13d
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_3:                                 ## =>This Inner Loop Header: Depth=1
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_qcam_await_ready2
	testq	%rax, %rax
	jne	LBB0_6
## %bb.4:                               ##   in Loop: Header=BB0_3 Depth=1
	movl	(%r15), %edi
	callq	_parport_read_data
	movl	%eax, %r14d
	movl	(%r15), %edi
	callq	_parport_read_status
	movl	%eax, %ebx
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_qcam_set_ack
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_qcam_await_ready2
	testq	%rax, %rax
	jne	LBB0_6
## %bb.5:                               ##   in Loop: Header=BB0_3 Depth=1
	shrl	%r14d
	movl	(%r15), %edi
	callq	_parport_read_data
	movl	%eax, %r12d
	shrl	%r12d
	movl	(%r15), %edi
	callq	_parport_read_status
	movl	%eax, %r15d
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	callq	_qcam_set_ack
	movl	%ebx, %eax
	andl	$8, %eax
	shll	$4, %eax
	orl	%r14d, %eax
	andl	$240, %ebx
	movl	%r15d, %ecx
	shrl	$4, %ecx
	andl	$15, %ecx
	orl	%ebx, %ecx
	xorb	$-120, %cl
	andl	$8, %r15d
	shll	$4, %r15d
	orl	%r12d, %r15d
	movq	-72(%rbp), %r12                 ## 8-byte Reload
	movq	_force_rgb@GOTPCREL(%rip), %rdx
	cmpq	$0, (%rdx)
	leal	1(%r13), %edx
	movl	%r13d, %esi
	movl	%eax, %edi
	cmovel	%r15d, %edi
	cmovel	%eax, %r15d
	movb	%dil, (%r12,%rsi)
	leal	2(%r13), %eax
	movb	%cl, (%r12,%rdx)
	movb	%r15b, (%r12,%rax)
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	addl	$3, %r13d
	cmpl	-60(%rbp), %r13d                ## 4-byte Folded Reload
	jb	LBB0_3
LBB0_6:
	movl	%r13d, %eax
	addq	$56, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_7:
	movq	%r12, -72(%rbp)                 ## 8-byte Spill
	xorl	%ecx, %ecx
	movl	$0, -48(%rbp)                   ## 4-byte Folded Spill
	xorl	%eax, %eax
LBB0_8:                                 ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_9 Depth 2
	movl	%eax, %r13d
	decl	%eax
	leaq	-43(,%r13), %rdx
	addq	%rbp, %rdx
	movq	%rdx, -80(%rbp)                 ## 8-byte Spill
	movl	%eax, %edi
	movl	%ecx, %esi
	.p2align	4, 0x90
LBB0_9:                                 ##   Parent Loop BB0_8 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	movq	%r13, %rax
	movabsq	$-6148914691236517205, %rcx     ## imm = 0xAAAAAAAAAAAAAAAB
	mulq	%rcx
	cmpl	%r14d, %r13d
	jae	LBB0_18
## %bb.10:                              ##   in Loop: Header=BB0_9 Depth=2
	movq	%rdx, %rbx
	movq	%rdi, -88(%rbp)                 ## 8-byte Spill
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_qcam_await_ready1
	testq	%rax, %rax
	jne	LBB0_6
## %bb.11:                              ##   in Loop: Header=BB0_9 Depth=2
	movl	(%r15), %edi
	callq	_parport_read_status
	movl	%eax, %r14d
	movq	%r15, %rdi
	movl	$1, %esi
	callq	_qcam_set_ack
	movq	%r15, %rdi
	xorl	%esi, %esi
	callq	_qcam_await_ready1
	testq	%rax, %rax
	jne	LBB0_6
## %bb.12:                              ##   in Loop: Header=BB0_9 Depth=2
	shrq	%rbx
	leaq	(%rbx,%rbx,2), %rax
	movq	-80(%rbp), %r12                 ## 8-byte Reload
	movq	%r12, %r15
	subq	%rax, %r15
	andl	$240, %r14d
	movq	-56(%rbp), %rax                 ## 8-byte Reload
	movl	(%rax), %edi
	callq	_parport_read_status
	movl	%eax, %ebx
	movq	-56(%rbp), %rdi                 ## 8-byte Reload
	xorl	%esi, %esi
	callq	_qcam_set_ack
	shrl	$4, %ebx
	andl	$15, %ebx
	orl	%r14d, %ebx
	xorb	$-120, %bl
	movq	%r13, %rax
	incq	%rax
	movl	%r13d, %ecx
	movl	$2863311531, %edx               ## imm = 0xAAAAAAAB
	imulq	%rdx, %rcx
	shrq	$33, %rcx
	leal	(%rcx,%rcx,2), %ecx
	movl	%r13d, %esi
	subl	%ecx, %esi
	movb	%bl, (%r15)
	movq	-56(%rbp), %r15                 ## 8-byte Reload
	movl	-60(%rbp), %r14d                ## 4-byte Reload
	movq	-88(%rbp), %rdi                 ## 8-byte Reload
	incl	%edi
	movq	%rdi, %rcx
	imulq	%rdx, %rcx
	shrq	$33, %rcx
	leal	(%rcx,%rcx,2), %ecx
	notl	%ecx
	addl	%eax, %ecx
	incq	%r12
	movq	%r12, -80(%rbp)                 ## 8-byte Spill
	movq	%rax, %r13
	cmpl	$2, %ecx
	jb	LBB0_9
## %bb.13:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	$2, %ecx
	jmp	LBB0_14
	.p2align	4, 0x90
LBB0_18:                                ##   in Loop: Header=BB0_8 Depth=1
	xorl	%ecx, %ecx
	testl	%esi, %esi
	je	LBB0_6
## %bb.19:                              ##   in Loop: Header=BB0_8 Depth=1
	movl	%r13d, %eax
LBB0_14:                                ##   in Loop: Header=BB0_8 Depth=1
	movq	-72(%rbp), %rsi                 ## 8-byte Reload
	movl	-48(%rbp), %edi                 ## 4-byte Reload
	movq	_force_rgb@GOTPCREL(%rip), %rdx
	cmpq	$0, (%rdx)
	movl	%edi, %edx
	je	LBB0_16
## %bb.15:                              ##   in Loop: Header=BB0_8 Depth=1
	movb	-43(%rbp), %bl
	movb	%bl, (%rsi,%rdx)
	movb	-42(%rbp), %bl
	movb	%bl, 1(%rsi,%rdx)
	movb	-41(%rbp), %bl
	jmp	LBB0_17
LBB0_16:                                ##   in Loop: Header=BB0_8 Depth=1
	movb	-41(%rbp), %bl
	movb	%bl, (%rsi,%rdx)
	movb	-42(%rbp), %bl
	movb	%bl, 1(%rsi,%rdx)
	movb	-43(%rbp), %bl
LBB0_17:                                ##   in Loop: Header=BB0_8 Depth=1
	addl	$3, %edi
	movl	%edi, -48(%rbp)                 ## 4-byte Spill
	movb	%bl, 2(%rdx,%rsi)
	jmp	LBB0_8
	.cfi_endproc
                                        ## -- End function
	.comm	_force_rgb,8,3                  ## @force_rgb
	.no_dead_strip	_qcam_read_bytes
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function qcam_read_bytes
_qcam_read_bytes:                       ; @qcam_read_bytes
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #112
	.cfi_def_cfa_offset 112
	stp	x28, x27, [sp, #16]             ; 16-byte Folded Spill
	stp	x26, x25, [sp, #32]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #48]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #64]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #80]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #96]             ; 16-byte Folded Spill
	add	x29, sp, #96
	.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	x19, x2
	mov	x20, x1
	mov	x21, x0
	mov	w1, #0
	bl	_qcam_set_ack
	ldr	x8, [x21, #8]
	cbz	x8, LBB0_7
; %bb.1:
	mov	w22, #0
	cbz	w19, LBB0_6
; %bb.2:
Lloh0:
	adrp	x27, _force_rgb@GOTPAGE
Lloh1:
	ldr	x27, [x27, _force_rgb@GOTPAGEOFF]
LBB0_3:                                 ; =>This Inner Loop Header: Depth=1
	mov	x0, x21
	mov	w1, #1
	bl	_qcam_await_ready2
	cbnz	x0, LBB0_6
; %bb.4:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
	bl	_parport_read_data
	mov	x23, x0
	ldr	w0, [x21]
	bl	_parport_read_status
	mov	x24, x0
	mov	x0, x21
	mov	w1, #1
	bl	_qcam_set_ack
	mov	x0, x21
	mov	w1, #0
	bl	_qcam_await_ready2
	cbnz	x0, LBB0_6
; %bb.5:                                ;   in Loop: Header=BB0_3 Depth=1
	ldr	w0, [x21]
	bl	_parport_read_data
	mov	x25, x0
	ldr	w0, [x21]
	bl	_parport_read_status
	mov	x26, x0
	mov	x0, x21
	mov	w1, #0
	bl	_qcam_set_ack
	lsl	w8, w24, #4
	and	w8, w8, #0x80
	orr	w8, w8, w23, lsr #1
	and	w9, w24, #0xf0
	bfxil	w9, w26, #4, #4
	eor	w9, w9, #0x88888888
	lsl	w10, w26, #4
	and	w10, w10, #0x80
	orr	w10, w10, w25, lsr #1
	ldr	x11, [x27]
	add	w12, w22, #1
	cmp	x11, #0
	csel	w11, w10, w8, eq
	csel	w8, w8, w10, eq
	strb	w11, [x20, w22, uxtw]
	add	w10, w22, #2
	strb	w9, [x20, w12, uxtw]
	strb	w8, [x20, w10, uxtw]
	add	w22, w22, #3
	cmp	w22, w19
	b.lo	LBB0_3
LBB0_6:
	mov	x0, x22
	ldp	x29, x30, [sp, #96]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #80]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #64]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #48]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #32]             ; 16-byte Folded Reload
	ldp	x28, x27, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #112
	ret
LBB0_7:
	str	wzr, [sp, #8]                   ; 4-byte Folded Spill
	mov	w9, #0
	mov	w27, #43691
	movk	w27, #43690, lsl #16
LBB0_8:                                 ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_9 Depth 2
	sub	w28, w9, #1
	mov	w22, w9
	add	x9, sp, #13
	add	x25, x9, x22
LBB0_9:                                 ;   Parent Loop BB0_8 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	cmp	w22, w19
	b.hs	LBB0_14
; %bb.10:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x0, x21
	mov	w1, #1
	bl	_qcam_await_ready1
	cbnz	x0, LBB0_6
; %bb.11:                               ;   in Loop: Header=BB0_9 Depth=2
	ldr	w0, [x21]
	bl	_parport_read_status
	mov	x23, x0
	mov	x0, x21
	mov	w1, #1
	bl	_qcam_set_ack
	mov	x0, x21
	mov	w1, #0
	bl	_qcam_await_ready1
	cbnz	x0, LBB0_6
; %bb.12:                               ;   in Loop: Header=BB0_9 Depth=2
	mov	x8, #-6148914691236517206
	movk	x8, #43691
	umulh	x8, x22, x8
	lsr	x8, x8, #1
	sub	x8, x8, x8, lsl #2
	add	x24, x25, x8
	and	w26, w23, #0xf0
	ldr	w0, [x21]
	bl	_parport_read_status
	mov	x23, x0
	mov	x0, x21
	mov	w1, #0
	bl	_qcam_set_ack
	bfxil	w26, w23, #4, #4
	eor	w10, w26, #0x88888888
	add	x9, x22, #1
	umull	x8, w22, w27
	lsr	x8, x8, #33
	add	w8, w8, w8, lsl #1
	sub	w8, w22, w8
	strb	w10, [x24]
	add	w28, w28, #1
	umull	x10, w28, w27
	lsr	x10, x10, #33
	sub	w10, w10, w10, lsl #2
	add	w10, w10, w9
	sub	w10, w10, #1
	add	x25, x25, #1
	mov	x22, x9
	cmp	w10, #2
	b.lo	LBB0_9
; %bb.13:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	w8, #2
	b	LBB0_16
LBB0_14:                                ;   in Loop: Header=BB0_8 Depth=1
	cbz	w8, LBB0_6
; %bb.15:                               ;   in Loop: Header=BB0_8 Depth=1
	mov	w8, #0
	mov	x9, x22
LBB0_16:                                ;   in Loop: Header=BB0_8 Depth=1
	ldr	w12, [sp, #8]                   ; 4-byte Folded Reload
Lloh2:
	adrp	x10, _force_rgb@GOTPAGE
Lloh3:
	ldr	x10, [x10, _force_rgb@GOTPAGEOFF]
Lloh4:
	ldr	x11, [x10]
	add	x10, x20, w12, uxtw
	cbz	x11, LBB0_18
; %bb.17:                               ;   in Loop: Header=BB0_8 Depth=1
	ldurh	w11, [sp, #13]
	strh	w11, [x20, w12, uxtw]
	ldrb	w11, [sp, #15]
	b	LBB0_19
LBB0_18:                                ;   in Loop: Header=BB0_8 Depth=1
	ldrb	w11, [sp, #15]
	strb	w11, [x10]
	ldrb	w11, [sp, #14]
	strb	w11, [x10, #1]
	ldrb	w11, [sp, #13]
LBB0_19:                                ;   in Loop: Header=BB0_8 Depth=1
	add	w12, w12, #3
	str	w12, [sp, #8]                   ; 4-byte Folded Spill
	strb	w11, [x10, #2]
	b	LBB0_8
	.loh AdrpLdrGot	Lloh0, Lloh1
	.loh AdrpLdrGotLdr	Lloh2, Lloh3, Lloh4
	.cfi_endproc
                                        ; -- End function
	.comm	_force_rgb,8,3                  ; @force_rgb
	.no_dead_strip	_qcam_read_bytes
.subsections_via_symbols
