	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	4, 0x90                         ## -- Begin function cpia_pp_streamRead
_cpia_pp_streamRead:                    ## @cpia_pp_streamRead
	.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	%rdi, %rdi
	je	LBB0_6
## %bb.1:
	movq	%rsi, %rbx
	testq	%rsi, %rsi
	je	LBB0_7
## %bb.2:
	movq	%rdi, %r13
	cmpq	$0, 16(%rdi)
	je	LBB0_4
## %bb.3:
	movl	8(%r13), %esi
	leaq	L_.str.2(%rip), %rdi
	xorl	%eax, %eax
	callq	_DBG
	decl	8(%r13)
LBB0_4:
	movl	$0, (%r13)
	movq	%r13, %rdi
	movl	$1, %esi
	callq	_ReverseSetup
	testq	%rax, %rax
	je	LBB0_11
## %bb.5:
	leaq	L_.str.3(%rip), %rdi
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DBG
	movq	_EIO@GOTPCREL(%rip), %rax
	jmp	LBB0_9
LBB0_6:
	leaq	L_.str(%rip), %rdi
	jmp	LBB0_8
LBB0_7:
	leaq	L_.str.1(%rip), %rdi
LBB0_8:
	xorl	%ebx, %ebx
	xorl	%eax, %eax
	callq	_DBG
	movq	_EINVAL@GOTPCREL(%rip), %rax
LBB0_9:
	subl	(%rax), %ebx
LBB0_10:
	movl	%ebx, %eax
	addq	$8, %rsp
	popq	%rbx
	popq	%r12
	popq	%r13
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_11:
	cmpl	$0, (%r13)
	movl	$0, %r12d
	je	LBB0_13
LBB0_12:
	movq	%r13, %rdi
	callq	_EndTransferMode
	movq	_EIO@GOTPCREL(%rip), %rax
	xorl	%ebx, %ebx
	subl	(%rax), %ebx
	cmpl	$0, (%r13)
	cmovnel	%r12d, %ebx
	jmp	LBB0_10
LBB0_13:
	movq	_PARPORT_CHUNK_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %r14d
	xorl	%r15d, %r15d
	xorl	%r12d, %r12d
	movq	%r13, -48(%rbp)                 ## 8-byte Spill
	.p2align	4, 0x90
LBB0_14:                                ## =>This Loop Header: Depth=1
                                        ##     Child Loop BB0_17 Depth 2
	xorl	%eax, %eax
	callq	_cond_resched
	movl	4(%r13), %edi
	movq	%rbx, %rsi
	movl	%r14d, %edx
	callq	_cpia_pp_read
	testl	%eax, %eax
	jle	LBB0_21
## %bb.15:                              ##   in Loop: Header=BB0_14 Depth=1
	xorl	%ecx, %ecx
	cmpl	$3, %r15d
	jg	LBB0_19
## %bb.16:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	_EOI@GOTPCREL(%rip), %rcx
	movq	(%rcx), %rdx
	xorl	%ecx, %ecx
	xorl	%edi, %edi
	.p2align	4, 0x90
LBB0_17:                                ##   Parent Loop BB0_14 Depth=1
                                        ## =>  This Inner Loop Header: Depth=2
	incl	%r15d
	cmpq	%rdx, (%rbx)
	cmovnel	%edi, %r15d
	addq	$8, %rbx
	incl	%ecx
	cmpl	%eax, %ecx
	jge	LBB0_19
## %bb.18:                              ##   in Loop: Header=BB0_17 Depth=2
	cmpl	$4, %r15d
	jl	LBB0_17
LBB0_19:                                ##   in Loop: Header=BB0_14 Depth=1
	addl	%ecx, %r12d
	cmpl	$4, %r15d
	je	LBB0_22
## %bb.20:                              ##   in Loop: Header=BB0_14 Depth=1
	movq	_CPIA_MAX_IMAGE_SIZE@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	subl	%r12d, %eax
	movq	_PARPORT_CHUNK_SIZE@GOTPCREL(%rip), %rcx
	cmpl	(%rcx), %eax
	cmovlel	%eax, %r14d
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	cmpl	$0, (%r13)
	je	LBB0_14
	jmp	LBB0_12
LBB0_21:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	jmp	LBB0_12
LBB0_22:
	movq	-48(%rbp), %r13                 ## 8-byte Reload
	movl	$1, (%r13)
	jmp	LBB0_12
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Internal driver error: cam is NULL\n"

	.comm	_EINVAL,4,2                     ## @EINVAL
L_.str.1:                               ## @.str.1
	.asciz	"Internal driver error: buffer is NULL\n"

L_.str.2:                               ## @.str.2
	.asciz	"%d\n"

L_.str.3:                               ## @.str.3
	.asciz	"unable to ReverseSetup\n"

	.comm	_EIO,4,2                        ## @EIO
	.comm	_PARPORT_CHUNK_SIZE,4,2         ## @PARPORT_CHUNK_SIZE
	.comm	_EOI,8,3                        ## @EOI
	.comm	_CPIA_MAX_IMAGE_SIZE,4,2        ## @CPIA_MAX_IMAGE_SIZE
	.comm	_EINTR,4,2                      ## @EINTR
	.comm	_EWOULDBLOCK,4,2                ## @EWOULDBLOCK
	.comm	_current,4,2                    ## @current
	.no_dead_strip	_cpia_pp_streamRead
.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.p2align	2                               ; -- Begin function cpia_pp_streamRead
_cpia_pp_streamRead:                    ; @cpia_pp_streamRead
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #96
	.cfi_def_cfa_offset 96
	stp	x26, x25, [sp, #16]             ; 16-byte Folded Spill
	stp	x24, x23, [sp, #32]             ; 16-byte Folded Spill
	stp	x22, x21, [sp, #48]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #64]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #80]             ; 16-byte Folded Spill
	add	x29, sp, #80
	.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	x0, LBB0_6
; %bb.1:
	mov	x20, x1
	cbz	x1, LBB0_7
; %bb.2:
	mov	x19, x0
	ldr	x8, [x0, #16]
	cbz	x8, LBB0_4
; %bb.3:
	ldr	w8, [x19, #8]
	str	x8, [sp]
Lloh0:
	adrp	x0, l_.str.2@PAGE
Lloh1:
	add	x0, x0, l_.str.2@PAGEOFF
	bl	_DBG
	ldr	w8, [x19, #8]
	sub	w8, w8, #1
	str	w8, [x19, #8]
LBB0_4:
	str	wzr, [x19]
	mov	x0, x19
	mov	w1, #1
	bl	_ReverseSetup
	cbz	x0, LBB0_11
; %bb.5:
Lloh2:
	adrp	x0, l_.str.3@PAGE
Lloh3:
	add	x0, x0, l_.str.3@PAGEOFF
	bl	_DBG
Lloh4:
	adrp	x8, _EIO@GOTPAGE
Lloh5:
	ldr	x8, [x8, _EIO@GOTPAGEOFF]
	b	LBB0_9
LBB0_6:
Lloh6:
	adrp	x0, l_.str@PAGE
Lloh7:
	add	x0, x0, l_.str@PAGEOFF
	b	LBB0_8
LBB0_7:
Lloh8:
	adrp	x0, l_.str.1@PAGE
Lloh9:
	add	x0, x0, l_.str.1@PAGEOFF
LBB0_8:
	bl	_DBG
Lloh10:
	adrp	x8, _EINVAL@GOTPAGE
Lloh11:
	ldr	x8, [x8, _EINVAL@GOTPAGEOFF]
LBB0_9:
	ldr	w8, [x8]
	neg	w0, w8
LBB0_10:
	ldp	x29, x30, [sp, #80]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #64]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #48]             ; 16-byte Folded Reload
	ldp	x24, x23, [sp, #32]             ; 16-byte Folded Reload
	ldp	x26, x25, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #96
	ret
LBB0_11:
	ldr	w8, [x19]
	cbz	w8, LBB0_14
; %bb.12:
	mov	w22, #0
LBB0_13:
	mov	x0, x19
	bl	_EndTransferMode
	ldr	w8, [x19]
Lloh12:
	adrp	x9, _EIO@GOTPAGE
Lloh13:
	ldr	x9, [x9, _EIO@GOTPAGEOFF]
Lloh14:
	ldr	w9, [x9]
	cmp	w8, #0
	csneg	w0, w22, w9, ne
	b	LBB0_10
LBB0_14:
	mov	w23, #0
	mov	w22, #0
Lloh15:
	adrp	x24, _PARPORT_CHUNK_SIZE@GOTPAGE
Lloh16:
	ldr	x24, [x24, _PARPORT_CHUNK_SIZE@GOTPAGEOFF]
	ldr	w21, [x24]
Lloh17:
	adrp	x25, _EOI@GOTPAGE
Lloh18:
	ldr	x25, [x25, _EOI@GOTPAGEOFF]
Lloh19:
	adrp	x26, _CPIA_MAX_IMAGE_SIZE@GOTPAGE
Lloh20:
	ldr	x26, [x26, _CPIA_MAX_IMAGE_SIZE@GOTPAGEOFF]
LBB0_15:                                ; =>This Loop Header: Depth=1
                                        ;     Child Loop BB0_18 Depth 2
	bl	_cond_resched
	ldr	w0, [x19, #4]
	mov	x1, x20
	mov	x2, x21
	bl	_cpia_pp_read
	cmp	w0, #1
	b.lt	LBB0_13
; %bb.16:                               ;   in Loop: Header=BB0_15 Depth=1
	cmp	w23, #3
	b.gt	LBB0_20
; %bb.17:                               ;   in Loop: Header=BB0_15 Depth=1
	mov	w8, #0
	ldr	x9, [x25]
LBB0_18:                                ;   Parent Loop BB0_15 Depth=1
                                        ; =>  This Inner Loop Header: Depth=2
	ldr	x10, [x20], #8
	cmp	x10, x9
	csinc	w23, wzr, w23, ne
	add	w8, w8, #1
	cmp	w8, w0
	b.ge	LBB0_21
; %bb.19:                               ;   in Loop: Header=BB0_18 Depth=2
	cmp	w23, #4
	b.lt	LBB0_18
	b	LBB0_21
LBB0_20:                                ;   in Loop: Header=BB0_15 Depth=1
	mov	w8, #0
LBB0_21:                                ;   in Loop: Header=BB0_15 Depth=1
	add	w22, w8, w22
	cmp	w23, #4
	b.eq	LBB0_23
; %bb.22:                               ;   in Loop: Header=BB0_15 Depth=1
	ldr	w8, [x26]
	ldr	w9, [x24]
	sub	w8, w8, w22
	cmp	w8, w9
	csel	w21, w21, w8, gt
	ldr	w8, [x19]
	cbz	w8, LBB0_15
	b	LBB0_13
LBB0_23:
	mov	w8, #1
	str	w8, [x19]
	b	LBB0_13
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh4, Lloh5
	.loh AdrpAdd	Lloh2, Lloh3
	.loh AdrpAdd	Lloh6, Lloh7
	.loh AdrpAdd	Lloh8, Lloh9
	.loh AdrpLdrGot	Lloh10, Lloh11
	.loh AdrpLdrGotLdr	Lloh12, Lloh13, Lloh14
	.loh AdrpLdrGot	Lloh19, Lloh20
	.loh AdrpLdrGot	Lloh17, Lloh18
	.loh AdrpLdrGot	Lloh15, Lloh16
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Internal driver error: cam is NULL\n"

	.comm	_EINVAL,4,2                     ; @EINVAL
l_.str.1:                               ; @.str.1
	.asciz	"Internal driver error: buffer is NULL\n"

l_.str.2:                               ; @.str.2
	.asciz	"%d\n"

l_.str.3:                               ; @.str.3
	.asciz	"unable to ReverseSetup\n"

	.comm	_EIO,4,2                        ; @EIO
	.comm	_PARPORT_CHUNK_SIZE,4,2         ; @PARPORT_CHUNK_SIZE
	.comm	_EOI,8,3                        ; @EOI
	.comm	_CPIA_MAX_IMAGE_SIZE,4,2        ; @CPIA_MAX_IMAGE_SIZE
	.comm	_EINTR,4,2                      ; @EINTR
	.comm	_EWOULDBLOCK,4,2                ; @EWOULDBLOCK
	.comm	_current,4,2                    ; @current
	.no_dead_strip	_cpia_pp_streamRead
.subsections_via_symbols
