	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpia2_usb_stream_start         ## -- Begin function cpia2_usb_stream_start
	.p2align	4, 0x90
_cpia2_usb_stream_start:                ## @cpia2_usb_stream_start
	.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	%r12
	pushq	%rbx
	.cfi_offset %rbx, -48
	.cfi_offset %r12, -40
	.cfi_offset %r14, -32
	.cfi_offset %r15, -24
	xorl	%r15d, %r15d
	cmpl	$0, (%rdi)
	je	LBB0_1
LBB0_13:
	movl	%r15d, %eax
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	retq
LBB0_1:
	movl	%esi, %r14d
	movq	%rdi, %rbx
	cmpl	$0, 4(%rdi)
	je	LBB0_10
## %bb.2:
	leaq	L_.str(%rip), %rdi
	callq	_DBG
	movl	8(%rbx), %r9d
	movq	48(%rbx), %r8
	testl	%r9d, %r9d
	jle	LBB0_9
## %bb.3:
	cmpl	$1, %r9d
	jne	LBB0_5
## %bb.4:
	xorl	%edx, %edx
	jmp	LBB0_7
LBB0_5:
	movl	%r9d, %esi
	andl	$-2, %esi
	leaq	40(%r8), %rdi
	xorl	%edx, %edx
	movq	_FRAME_EMPTY@GOTPCREL(%rip), %rax
	.p2align	4, 0x90
LBB0_6:                                 ## =>This Inner Loop Header: Depth=1
	movl	(%rax), %ecx
	movl	%ecx, -24(%rdi)
	movq	$0, -32(%rdi)
	movl	(%rax), %ecx
	movl	%ecx, (%rdi)
	movq	$0, -8(%rdi)
	addq	$2, %rdx
	addq	$48, %rdi
	cmpq	%rdx, %rsi
	jne	LBB0_6
LBB0_7:
	testb	$1, %r9b
	je	LBB0_9
## %bb.8:
	movq	_FRAME_EMPTY@GOTPCREL(%rip), %rax
	movl	(%rax), %eax
	leaq	(%rdx,%rdx,2), %rcx
	movl	%eax, 16(%r8,%rcx,8)
	movq	$0, 8(%r8,%rcx,8)
LBB0_9:
	movq	%r8, 32(%rbx)
	movl	(%r8), %eax
	movl	%eax, 40(%rbx)
	movl	$0, 4(%rbx)
LBB0_10:
	movl	24(%rbx), %r12d
	movl	$0, 24(%rbx)
	movq	%rbx, %rdi
	movl	%r14d, %esi
	callq	_cpia2_usb_change_streaming_alternate
	testl	%eax, %eax
	js	LBB0_11
## %bb.14:
	movq	$0, 16(%rbx)
	movl	$1, (%rbx)
	movq	%rbx, %rdi
	popq	%rbx
	popq	%r12
	popq	%r14
	popq	%r15
	popq	%rbp
	jmp	_cpia2_usb_stream_resume        ## TAILCALL
LBB0_11:
	movl	%eax, %r15d
	leaq	L_.str.1(%rip), %rdi
	movl	%eax, %esi
	xorl	%eax, %eax
	callq	_ERR
	movl	%r12d, 24(%rbx)
	movq	_USBIF_CMDONLY@GOTPCREL(%rip), %rax
	movl	(%rax), %esi
	movq	%rbx, %rdi
	callq	_set_alternate
	testl	%eax, %eax
	jns	LBB0_13
## %bb.12:
	leaq	L_.str.2(%rip), %rdi
	movl	%r14d, %esi
	movl	%r15d, %edx
	movl	%eax, %ecx
	xorl	%eax, %eax
	callq	_ERR
	jmp	LBB0_13
	.cfi_endproc
                                        ## -- End function
	.section	__TEXT,__cstring,cstring_literals
L_.str:                                 ## @.str
	.asciz	"Flushing buffers\n"

	.comm	_FRAME_EMPTY,4,2                ## @FRAME_EMPTY
L_.str.1:                               ## @.str.1
	.asciz	"cpia2_usb_change_streaming_alternate() = %d!\n"

	.comm	_USBIF_CMDONLY,4,2              ## @USBIF_CMDONLY
L_.str.2:                               ## @.str.2
	.asciz	"cpia2_usb_change_streaming_alternate(%d) =%d has already failed. Then tried to call set_alternate(USBIF_CMDONLY) = %d.\n"

.subsections_via_symbols

	.section	__TEXT,__text,regular,pure_instructions
	.build_version macos, 13, 0	sdk_version 13, 3
	.globl	_cpia2_usb_stream_start         ; -- Begin function cpia2_usb_stream_start
	.p2align	2
_cpia2_usb_stream_start:                ; @cpia2_usb_stream_start
	.cfi_startproc
; %bb.0:
	sub	sp, sp, #64
	.cfi_def_cfa_offset 64
	stp	x22, x21, [sp, #16]             ; 16-byte Folded Spill
	stp	x20, x19, [sp, #32]             ; 16-byte Folded Spill
	stp	x29, x30, [sp, #48]             ; 16-byte Folded Spill
	add	x29, sp, #48
	.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
	ldr	w8, [x0]
	cbz	w8, LBB0_3
; %bb.1:
	mov	w21, #0
LBB0_2:
	mov	x0, x21
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	ret
LBB0_3:
	mov	x19, x1
	mov	x20, x0
	ldr	w8, [x0, #4]
	cbz	w8, LBB0_8
; %bb.4:
Lloh0:
	adrp	x0, l_.str@PAGE
Lloh1:
	add	x0, x0, l_.str@PAGEOFF
	bl	_DBG
	ldr	w8, [x20, #8]
	ldr	x9, [x20, #48]
	cmp	w8, #1
	b.lt	LBB0_7
; %bb.5:
	add	x10, x9, #16
Lloh2:
	adrp	x11, _FRAME_EMPTY@GOTPAGE
Lloh3:
	ldr	x11, [x11, _FRAME_EMPTY@GOTPAGEOFF]
LBB0_6:                                 ; =>This Inner Loop Header: Depth=1
	ldr	w12, [x11]
	str	w12, [x10]
	stur	xzr, [x10, #-8]
	add	x10, x10, #24
	subs	x8, x8, #1
	b.ne	LBB0_6
LBB0_7:
	str	x9, [x20, #32]
	ldr	w8, [x9]
	str	w8, [x20, #40]
	str	wzr, [x20, #4]
LBB0_8:
	ldr	w22, [x20, #24]
	str	wzr, [x20, #24]
	mov	x0, x20
	mov	x1, x19
	bl	_cpia2_usb_change_streaming_alternate
	tbnz	w0, #31, LBB0_10
; %bb.9:
	str	xzr, [x20, #16]
	mov	w8, #1
	str	w8, [x20]
	mov	x0, x20
	ldp	x29, x30, [sp, #48]             ; 16-byte Folded Reload
	ldp	x20, x19, [sp, #32]             ; 16-byte Folded Reload
	ldp	x22, x21, [sp, #16]             ; 16-byte Folded Reload
	add	sp, sp, #64
	b	_cpia2_usb_stream_resume
LBB0_10:
	mov	x21, x0
Lloh4:
	adrp	x0, l_.str.1@PAGE
Lloh5:
	add	x0, x0, l_.str.1@PAGEOFF
	mov	x1, x21
	bl	_ERR
	str	w22, [x20, #24]
Lloh6:
	adrp	x8, _USBIF_CMDONLY@GOTPAGE
Lloh7:
	ldr	x8, [x8, _USBIF_CMDONLY@GOTPAGEOFF]
Lloh8:
	ldr	w1, [x8]
	mov	x0, x20
	bl	_set_alternate
                                        ; kill: def $w0 killed $w0 def $x0
	tbz	w0, #31, LBB0_2
; %bb.11:
	stp	x21, x0, [sp]
Lloh9:
	adrp	x0, l_.str.2@PAGE
Lloh10:
	add	x0, x0, l_.str.2@PAGEOFF
	mov	x1, x19
	bl	_ERR
	b	LBB0_2
	.loh AdrpAdd	Lloh0, Lloh1
	.loh AdrpLdrGot	Lloh2, Lloh3
	.loh AdrpLdrGotLdr	Lloh6, Lloh7, Lloh8
	.loh AdrpAdd	Lloh4, Lloh5
	.loh AdrpAdd	Lloh9, Lloh10
	.cfi_endproc
                                        ; -- End function
	.section	__TEXT,__cstring,cstring_literals
l_.str:                                 ; @.str
	.asciz	"Flushing buffers\n"

	.comm	_FRAME_EMPTY,4,2                ; @FRAME_EMPTY
l_.str.1:                               ; @.str.1
	.asciz	"cpia2_usb_change_streaming_alternate() = %d!\n"

	.comm	_USBIF_CMDONLY,4,2              ; @USBIF_CMDONLY
l_.str.2:                               ; @.str.2
	.asciz	"cpia2_usb_change_streaming_alternate(%d) =%d has already failed. Then tried to call set_alternate(USBIF_CMDONLY) = %d.\n"

.subsections_via_symbols
